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
+3 -3
View File
@@ -51,7 +51,7 @@ export class AdminService {
});
await this.em.persistAndFlush(admin);
}
const role = await this.em.findOne(Role, { id: roleId });
const role = await this.em.findOne(Role, { id: roleId, isSystem: false });
if (!role) throw new NotFoundException('Role not found');
const restaurant = await this.em.findOne(Restaurant, { id: restId });
@@ -131,8 +131,8 @@ export class AdminService {
}
// Update role if roleId is provided
if (roleId ) {
const role = await this.em.findOne(Role, { id: roleId });
if (roleId) {
const role = await this.em.findOne(Role, { id: roleId, isSystem: false });
if (!role) {
throw new NotFoundException('Role not found');
}