Multi-environment and multi-user construction
This commit is contained in:
@@ -384,7 +384,10 @@ export class MessageAutomationsService {
|
||||
}
|
||||
if (userId && wantSms) {
|
||||
const user = await this.prisma.user.findFirst({
|
||||
where: { id: userId, organizationId: job.organizationId },
|
||||
where: {
|
||||
id: userId,
|
||||
memberships: { some: { organizationId: job.organizationId } },
|
||||
},
|
||||
select: { mobile: true },
|
||||
});
|
||||
await this.sendSms(user?.mobile, smsText);
|
||||
|
||||
Reference in New Issue
Block a user