Skip to content

Commit

Permalink
fix: make deleteProject idempotent
Browse files Browse the repository at this point in the history
In order to avoid user clicking on it after a timeout.

Fix ARGOS-SERVER-XRN
  • Loading branch information
gregberge committed Jan 21, 2025
1 parent 381d6c9 commit b968377
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions apps/backend/src/graphql/definitions/Project.ts
Original file line number Diff line number Diff line change
Expand Up @@ -848,6 +848,10 @@ export const resolvers: IResolvers = {
});
},
deleteProject: async (_root, args, ctx) => {
const project = await Project.query().findById(args.id);
if (!project) {
return true;
}
await deleteProject({ id: args.id, user: ctx.auth?.user });
return true;
},
Expand Down

0 comments on commit b968377

Please sign in to comment.