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:
Mathis H (Avnyr) 2024-04-29 11:30:59 +02:00
parent 0053c0ce19
commit 2796b514eb
Signed by: Mathis
GPG Key ID: DD9E0666A747D126

View File

@ -3,6 +3,7 @@ import AdminGuard from "@validators/AdminGuard";
import UserGuard from "@validators/UserGuard"; import UserGuard from "@validators/UserGuard";
import CategoryController from "@controllers/category.controller"; import CategoryController from "@controllers/category.controller";
import ModelController from "@controllers/model.controller"; import ModelController from "@controllers/model.controller";
import BrandController from "@controllers/brand.controller";
const CatalogRouter: Router = express.Router(); const CatalogRouter: Router = express.Router();
@ -33,11 +34,11 @@ CatalogRouter.route('/category/:categorySlug')
//-- BRAND >> //-- BRAND >>
CatalogRouter.route('/brand/new').post(AdminGuard) CatalogRouter.route('/brand/new').post(AdminGuard, BrandController.create)
CatalogRouter.route('/brand/all').get() CatalogRouter.route('/brand/all').get(BrandController.getAll)
CatalogRouter.route('/brand/:brandSlug') CatalogRouter.route('/brand/:brandSlug')
.get(UserGuard) .get(UserGuard, BrandController.getBySlug)
.patch(AdminGuard) .patch(AdminGuard, BrandController.update)
.delete(AdminGuard) .delete(AdminGuard, BrandController.delete)
export default CatalogRouter; export default CatalogRouter;