return early if userIds is empty

This commit is contained in:
Philipinho
2025-07-08 02:14:45 -07:00
parent 8a20a9ea0d
commit 5e6cf2af4b

View File

@ -47,6 +47,8 @@ export class GroupUserService {
const db = dbOrTx(this.db, trx); const db = dbOrTx(this.db, trx);
await this.groupService.findAndValidateGroup(groupId, workspaceId, trx); await this.groupService.findAndValidateGroup(groupId, workspaceId, trx);
if (userIds.length === 0) return;
// make sure we have valid workspace users // make sure we have valid workspace users
const validUsers = await db const validUsers = await db
.selectFrom('users') .selectFrom('users')