fix(invites): Fix regression to invite creation (#359)

This commit is contained in:
Brendan Kellam 2025-06-20 12:49:25 -07:00 committed by GitHub
parent 10f9f6b6a3
commit fb2ef05172
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 12 additions and 0 deletions

View file

@ -7,6 +7,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [Unreleased] ## [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 ## [4.4.0] - 2025-06-18
### Added ### Added

View file

@ -1055,6 +1055,15 @@ export const createInvites = async (emails: string[], domain: string): Promise<{
} satisfies ServiceError; } satisfies ServiceError;
} }
await prisma.invite.createMany({
data: emails.map((email) => ({
recipientEmail: email,
hostUserId: userId,
orgId: org.id,
})),
skipDuplicates: true,
});
// Send invites to recipients // Send invites to recipients
if (env.SMTP_CONNECTION_URL && env.EMAIL_FROM_ADDRESS) { if (env.SMTP_CONNECTION_URL && env.EMAIL_FROM_ADDRESS) {
const origin = (await headers()).get('origin')!; const origin = (await headers()).get('origin')!;