mirror of
https://github.com/docmost/docmost
synced 2025-03-28 21:13:28 +00:00
fix: consider the case when there is no invitations
This commit is contained in:
parent
367b1f89a6
commit
997ef0d072
@ -41,7 +41,7 @@ export class WorkspaceInvitationService {
|
||||
@InjectKysely() private readonly db: KyselyDB,
|
||||
@InjectQueue(QueueName.BILLING_QUEUE) private billingQueue: Queue,
|
||||
private readonly environmentService: EnvironmentService,
|
||||
) {}
|
||||
) { }
|
||||
|
||||
async getInvitations(workspaceId: string, pagination: PaginationOptions) {
|
||||
let query = this.db
|
||||
@ -141,6 +141,9 @@ export class WorkspaceInvitationService {
|
||||
groupIds: validGroups?.map((group: Partial<Group>) => group.id),
|
||||
}));
|
||||
|
||||
// When there is nobody to invite
|
||||
if (invitesToInsert.length < 1) return;
|
||||
|
||||
invites = await trx
|
||||
.insertInto('workspaceInvitations')
|
||||
.values(invitesToInsert)
|
||||
|
Loading…
x
Reference in New Issue
Block a user