bugfix: a new flow added to disable staffs and free the used seats.

This commit is contained in:
2026-05-18 14:58:47 +03:30
parent 4487d3260b
commit 10d8fac3f8
2 changed files with 8 additions and 31 deletions

View File

@@ -756,18 +756,7 @@ export class AuthService {
throw new UnauthorizedException('Access denied to this organization');
}
if (!membership.isOwner && !membership.isActive) {
const acceptedInvite = await this.prisma.staffInvitation.findFirst({
where: {
membershipId: membership.id,
acceptedAt: { not: null },
},
select: { id: true },
});
throw new UnauthorizedException(
acceptedInvite
? 'Your access to this organization has been disabled.'
: 'Your invitation is still pending activation.',
);
throw new UnauthorizedException('Your invitation is still pending activation');
}
// 2. Build payload WITH org context