isSystem: false

This commit is contained in:
2025-11-24 20:39:23 +03:30
parent 26b5d2b561
commit bd8c64f7c4
4 changed files with 11 additions and 8 deletions
+2 -1
View File
@@ -39,6 +39,7 @@ export class RolesService {
const role = this.roleRepository.create({
name,
restaurant,
isSystem: false,
});
// Add permissions if provided
@@ -60,7 +61,7 @@ export class RolesService {
}
async findAllGeneralAndRestaurantRoles(restId: string) {
const where: FilterQuery<Role> = { $or: [{ restaurant: restId }, { restaurant: null }] };
const where: FilterQuery<Role> = { $or: [{ restaurant: restId }, { restaurant: null }], isSystem: false };
const roles = await this.roleRepository.find(where, {
orderBy: { createdAt: 'desc' },