diff --git a/CHANGELOG.md b/CHANGELOG.md index 221874f7..42b9e551 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +### Fixed +- Fixed issue where invites appeared to be created successfully, but were not actually being created in the database. [#359](https://github.com/sourcebot-dev/sourcebot/pull/359) + ## [4.4.0] - 2025-06-18 ### Added diff --git a/packages/web/src/actions.ts b/packages/web/src/actions.ts index 3497e397..e9adbc2a 100644 --- a/packages/web/src/actions.ts +++ b/packages/web/src/actions.ts @@ -1055,6 +1055,15 @@ export const createInvites = async (emails: string[], domain: string): Promise<{ } satisfies ServiceError; } + await prisma.invite.createMany({ + data: emails.map((email) => ({ + recipientEmail: email, + hostUserId: userId, + orgId: org.id, + })), + skipDuplicates: true, + }); + // Send invites to recipients if (env.SMTP_CONNECTION_URL && env.EMAIL_FROM_ADDRESS) { const origin = (await headers()).get('origin')!;