feat(routes): add BrandController methods to catalog routes
The commit introduces BrandController methods to the catalog router. Specifically, it implements create, getAll, getBySlug, update, and delete functionalities for brand routes. This update enhances brand management within the catalog. Signed-off-by: Mathis <yidhra@tuta.io>
This commit is contained in:
@@ -3,6 +3,7 @@ import AdminGuard from "@validators/AdminGuard";
|
||||
import UserGuard from "@validators/UserGuard";
|
||||
import CategoryController from "@controllers/category.controller";
|
||||
import ModelController from "@controllers/model.controller";
|
||||
import BrandController from "@controllers/brand.controller";
|
||||
|
||||
|
||||
const CatalogRouter: Router = express.Router();
|
||||
@@ -33,11 +34,11 @@ CatalogRouter.route('/category/:categorySlug')
|
||||
|
||||
//-- BRAND >>
|
||||
|
||||
CatalogRouter.route('/brand/new').post(AdminGuard)
|
||||
CatalogRouter.route('/brand/all').get()
|
||||
CatalogRouter.route('/brand/new').post(AdminGuard, BrandController.create)
|
||||
CatalogRouter.route('/brand/all').get(BrandController.getAll)
|
||||
CatalogRouter.route('/brand/:brandSlug')
|
||||
.get(UserGuard)
|
||||
.patch(AdminGuard)
|
||||
.delete(AdminGuard)
|
||||
.get(UserGuard, BrandController.getBySlug)
|
||||
.patch(AdminGuard, BrandController.update)
|
||||
.delete(AdminGuard, BrandController.delete)
|
||||
|
||||
export default CatalogRouter;
|
||||
Reference in New Issue
Block a user