mirror of
https://github.com/sourcebot-dev/sourcebot.git
synced 2025-12-12 04:15:30 +00:00
fix(invites): Fix regression to invite creation (#359)
This commit is contained in:
parent
10f9f6b6a3
commit
fb2ef05172
2 changed files with 12 additions and 0 deletions
|
|
@ -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
|
||||||
|
|
|
||||||
|
|
@ -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')!;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue