Multi-environment and multi-user construction

This commit is contained in:
2026-09-15 21:37:58 +03:30
parent e61fad95c6
commit d3f97b9dc4
37 changed files with 1349 additions and 201 deletions
+4 -1
View File
@@ -425,7 +425,10 @@ export class SalesService {
return null;
}
const user = await this.prisma.user.findFirst({
where: { id: requested, organizationId: actor.organizationId },
where: {
id: requested,
memberships: { some: { organizationId: actor.organizationId } },
},
select: { id: true },
});
if (!user) throw new BadRequestException('کاربر هدف معتبر نیست');