fix: validate activity, deal and lead assignees by active membership in the current environment
This commit is contained in:
@@ -519,7 +519,11 @@ export class DealsService {
|
||||
];
|
||||
if (!ids.length) return [];
|
||||
const count = await this.prisma.user.count({
|
||||
where: { organizationId, id: { in: ids }, isActive: true },
|
||||
where: {
|
||||
id: { in: ids },
|
||||
isActive: true,
|
||||
memberships: { some: { organizationId, isActive: true } },
|
||||
},
|
||||
});
|
||||
if (count !== ids.length) {
|
||||
throw new BadRequestException('یکی از مسئولان انتخابشده معتبر نیست');
|
||||
|
||||
Reference in New Issue
Block a user