isSystem: false
This commit is contained in:
@@ -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');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user