Skip to content

Commit aa34fe7

Browse files
committed
fix being able to accept multiple times by invite code
1 parent 2e22544 commit aa34fe7

1 file changed

Lines changed: 3 additions & 6 deletions

File tree

src/invites/mutations/acceptInvite.ts

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -226,12 +226,9 @@ export default resolver.pipe(
226226
ctx
227227
)
228228

229-
// Delete invitation(s) for that email and project Id
230-
await db.invitation.deleteMany({
231-
where: {
232-
email: invite.email,
233-
projectId: invite.projectId,
234-
},
229+
// Delete this specific invitation by id so it can only be used once
230+
await db.invitation.delete({
231+
where: { id: invite.id },
235232
})
236233

237234
return project

0 commit comments

Comments
 (0)