Skip to content

Commit 0d11391

Browse files
committed
Dedupe the invite emails in the application
1 parent a3a3549 commit 0d11391

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

apps/webapp/app/models/member.server.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ export async function inviteMembers({
9999
throw new Error("User does not have access to this organization");
100100
}
101101

102-
const invites = emails.map(
102+
const invites = [...new Set(emails)].map(
103103
(email) =>
104104
({
105105
email,
@@ -112,7 +112,6 @@ export async function inviteMembers({
112112

113113
await prisma.orgMemberInvite.createMany({
114114
data: invites,
115-
skipDuplicates: true,
116115
});
117116

118117
return await prisma.orgMemberInvite.findMany({

0 commit comments

Comments
 (0)