Only delete invites on tenant where staff was deleted

This commit is contained in:
Hendrik Belitz
2026-05-16 19:18:25 +02:00
parent e9c96c049e
commit 5e77fd1df4
+6 -3
View File
@@ -213,9 +213,12 @@ export class StaffService {
const deletedInvites = await tx
.delete(userInvite)
.where(
or(
eq(userInvite.createdUserId, staffId),
eq(userInvite.email, userToDelete[0].email),
and(
eq(userInvite.tenantId, tenantId),
or(
eq(userInvite.createdUserId, staffId),
eq(userInvite.email, userToDelete[0].email),
),
),
);
logger.debug("Deleted user invites", {