Skip to content

📈 Open source, privacy-first web analytics — a cookie-less Google Analytics alternative with built-in error tracking and performance monitoring. Self-host it or use our cloud. Get started for free!

added ability to accept share by following link

Blue Mouse0689d4e35ae0
diff --git a/src/project/project.controller.ts b/src/project/project.controller.ts
index 73e5f55a7..890b4d037 100644
--- a/src/project/project.controller.ts
+++ b/src/project/project.controller.ts
@@ -614,14 +614,22 @@ export class ProjectController {
throw new BadRequestException('Incorrect token provided')
}
- console.log(actionToken, actionToken.action, ActionTokenType.PROJECT_SHARE)
+ if (actionToken.action === ActionTokenType.PROJECT_SHARE) {
+ const { newValue: shareId, id, user } = actionToken
- // TODO
+ const share = await this.projectService.findOneShare(shareId)
+ share.confirmed = true
- if (actionToken.action === ActionTokenType.PROJECT_SHARE) {
- // await this.userService.update(actionToken.user.id, { ...actionToken.user, isActive: true})
- // await this.actionTokensService.delete(actionToken.id)
- // return
+ if (_isEmpty(share)) {
+ throw new BadRequestException('The provided share ID is not valid')
+ }
+
+ // if (share.user?.id !== user.id) {
+ // throw new BadRequestException('You are not allowed to manage this share')
+ // }
+
+ await this.projectService.updateShare(shareId, share)
+ await this.actionTokensService.delete(id)
}
}
}