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!

Updated function for confirm transfer project

Yevhenii Kulisidi7a50e9ad6032
diff --git a/src/project/project.controller.ts b/src/project/project.controller.ts
index 500e276a8..5ea509356 100644
--- a/src/project/project.controller.ts
+++ b/src/project/project.controller.ts
@@ -1331,6 +1331,7 @@ export class ProjectController {
await this.projectService.confirmTransferProject(
params.projectId,
actionToken.user.id,
+ project.admin.id,
actionToken.id,
)
}
diff --git a/src/project/project.service.ts b/src/project/project.service.ts
index dccfe9092..46d8c6224 100644
--- a/src/project/project.service.ts
+++ b/src/project/project.service.ts
@@ -657,12 +657,19 @@ export class ProjectService {
async confirmTransferProject(
projectId: string,
userId: string,
+ oldAdminId: string,
token: string,
) {
await this.projectsRepository.update(
{ id: projectId },
{ admin: { id: userId } },
)
+ await this.projectShareRepository.save({
+ user: { id: oldAdminId },
+ project: { id: projectId },
+ confirmed: true,
+ role: Role.admin,
+ })
await this.actionTokens.deleteActionToken(token)
}
}