refactor: Split category management into separate public and admin controllers, adjusting routes and tags accordingly.
This commit is contained in:
parent
4c9ad1cea7
commit
e379ed83c8
1 changed files with 9 additions and 3 deletions
|
|
@ -3,9 +3,9 @@ import { ValidationError } from '../middleware/errorHandler';
|
|||
import { CategoryService } from '../services/categories.service';
|
||||
import { createCategory, createCategoryResponse, deleteCategoryResponse, updateCategory, updateCategoryResponse, listCategoriesResponse } from '../types/categories.type';
|
||||
|
||||
@Route('api/admin/categories')
|
||||
@Tags('Admin/Categories')
|
||||
export class CategoriesController extends Controller {
|
||||
@Route('api/categories')
|
||||
@Tags('Categories')
|
||||
export class CategoriesController {
|
||||
private categoryService = new CategoryService();
|
||||
|
||||
@Get()
|
||||
|
|
@ -14,6 +14,12 @@ export class CategoriesController extends Controller {
|
|||
public async listCategories(): Promise<listCategoriesResponse> {
|
||||
return await this.categoryService.listCategories();
|
||||
}
|
||||
}
|
||||
|
||||
@Route('api/admin/categories')
|
||||
@Tags('Admin/Categories')
|
||||
export class CategoriesAdminController {
|
||||
private categoryService = new CategoryService();
|
||||
|
||||
@Post()
|
||||
@Security('jwt', ['admin'])
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue