Skip to content

Papermark is the open-source DocSend alternative and secure data rooms with built-in analytics and custom domains.

fix: unique constraint

Marc Seitz1fc1dc1ef304
diff --git a/pages/api/teams/[teamId]/invitations/index.ts b/pages/api/teams/[teamId]/invitations/index.ts
index f63a7354..1a2ef0ac 100644
--- a/pages/api/teams/[teamId]/invitations/index.ts
+++ b/pages/api/teams/[teamId]/invitations/index.ts
@@ -78,8 +78,10 @@ export default async function handle(
// delete invitation
await prisma.invitation.delete({
where: {
- teamId: teamId,
- email: email,
+ email_teamId: {
+ teamId: teamId,
+ email: email,
+ },
},
});
diff --git a/pages/api/teams/[teamId]/invitations/resend.ts b/pages/api/teams/[teamId]/invitations/resend.ts
index ce22ccce..c30dd553 100644
--- a/pages/api/teams/[teamId]/invitations/resend.ts
+++ b/pages/api/teams/[teamId]/invitations/resend.ts
@@ -59,8 +59,10 @@ export default async function handle(
// update invitation
const invitation = await prisma.invitation.update({
where: {
- email: email,
- teamId: teamId,
+ email_teamId: {
+ email: email,
+ teamId: teamId,
+ },
},
data: {
expires: expiresAt,