Enhance CategoryController and CategoryService to enforce admin-only access for category management; introduce restaurant-specific handling by adding RestId parameter to relevant methods; implement new endpoint for retrieving categories by restaurant for user access.
This commit is contained in:
@@ -5,8 +5,8 @@ import { Restaurant } from 'src/modules/restaurants/entities/restaurant.entity';
|
||||
import { Admin } from './admin.entity';
|
||||
|
||||
@Entity({ tableName: 'admin_roles' })
|
||||
@Unique({ properties: ['admin', 'role', 'restaurant'] })
|
||||
export class AdminRole extends BaseEntity {
|
||||
@Unique({ properties: ['admin.id', 'role.id', 'restaurant.id'] })
|
||||
@ManyToOne(() => Admin)
|
||||
admin!: Admin;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user