Skip to content

Commit a7fa8e0

Browse files
committed
Mark the project as deleted last
1 parent f32720a commit a7fa8e0

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

apps/webapp/app/services/deleteProject.server.ts

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -35,18 +35,6 @@ export class DeleteProjectService {
3535
return;
3636
}
3737

38-
// Mark the project as deleted
39-
// - This disables all API keys
40-
// - This disables all schedules from being scheduled
41-
await this.#prismaClient.project.update({
42-
where: {
43-
id: project.id,
44-
},
45-
data: {
46-
deletedAt: new Date(),
47-
},
48-
});
49-
5038
// Remove queues from MARQS
5139
for (const environment of project.environments) {
5240
await marqs?.removeEnvironmentQueuesFromMasterQueue(project.organization.id, environment.id);
@@ -67,6 +55,18 @@ export class DeleteProjectService {
6755
projectId: project.id,
6856
});
6957
}
58+
59+
// Mark the project as deleted (do this last because it makes it impossible to try again)
60+
// - This disables all API keys
61+
// - This disables all schedules from being scheduled
62+
await this.#prismaClient.project.update({
63+
where: {
64+
id: project.id,
65+
},
66+
data: {
67+
deletedAt: new Date(),
68+
},
69+
});
7070
}
7171

7272
async #getProjectId(options: Options) {

0 commit comments

Comments
 (0)