Multi-environment and multi-user construction
This commit is contained in:
@@ -96,10 +96,24 @@ export class ChequeRemindersService {
|
||||
|
||||
const staff = await this.prisma.user.findMany({
|
||||
where: {
|
||||
organizationId: row.organizationId,
|
||||
OR: [
|
||||
{ role: { in: ['owner', 'admin'] } },
|
||||
...(row.ownerId ? [{ id: row.ownerId }] : []),
|
||||
{
|
||||
memberships: {
|
||||
some: {
|
||||
organizationId: row.organizationId,
|
||||
role: { in: ['owner', 'admin'] },
|
||||
isActive: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
...(row.ownerId
|
||||
? [
|
||||
{
|
||||
id: row.ownerId,
|
||||
memberships: { some: { organizationId: row.organizationId } },
|
||||
},
|
||||
]
|
||||
: []),
|
||||
],
|
||||
},
|
||||
select: { id: true, mobile: true },
|
||||
|
||||
Reference in New Issue
Block a user