update notif

This commit is contained in:
2025-12-12 21:28:46 +03:30
parent ecb68de7b3
commit 249e7f7581
10 changed files with 216 additions and 127 deletions
@@ -174,4 +174,5 @@ export class AdminService {
}
return this.em.removeAndFlush(adminRole);
}
}
@@ -47,4 +47,12 @@ export class AdminRepository extends EntityRepository<Admin> {
return adminRole.admin;
}
async findAdminsWithPermission(restaurantId: string, permission: string): Promise<Admin[]> {
const admins = await this.em.find(
Admin,
{ roles: { restaurant: { id: restaurantId }, role: { permissions: { name: permission } } } },
{ populate: ['roles', 'roles.role', 'roles.role.permissions'] },
);
return admins;
}
}