feat(all): refactor code for readability and simplicity

The controllers, services, routes, and others have been updated to reduce code complexity and improve readability. Changes include removing unnecessary lines, replacing long function signatures with simpler versions, and streamlining condition checks and logger statements.

Signed-off-by: Mathis <yidhra@tuta.io>
This commit is contained in:
2024-04-30 11:03:28 +02:00
parent 28671146d1
commit a6593cb76f
14 changed files with 94 additions and 286 deletions

View File

@@ -9,10 +9,7 @@ const CatalogRouter: Router = express.Router();
//-- MODELS >>
CatalogRouter.route("/model/new").get(
AdminGuard,
ModelController.create,
);
CatalogRouter.route("/model/new").get(AdminGuard, ModelController.create);
CatalogRouter.route("/model/all").get(ModelController.getAll);
@@ -23,14 +20,9 @@ CatalogRouter.route("/model/:modelSlug")
//-- CATEGORY >>
CatalogRouter.route("/category/new").get(
AdminGuard,
CategoryController.create,
);
CatalogRouter.route("/category/new").get(AdminGuard, CategoryController.create);
CatalogRouter.route("/category/all").get(
CategoryController.getAll,
);
CatalogRouter.route("/category/all").get(CategoryController.getAll);
CatalogRouter.route("/category/:categorySlug")
.get(UserGuard, CategoryController.getBySlug)
@@ -39,10 +31,7 @@ CatalogRouter.route("/category/:categorySlug")
//-- BRAND >>
CatalogRouter.route("/brand/new").post(
AdminGuard,
BrandController.create,
);
CatalogRouter.route("/brand/new").post(AdminGuard, BrandController.create);
CatalogRouter.route("/brand/all").get(BrandController.getAll);
CatalogRouter.route("/brand/:brandSlug")
.get(UserGuard, BrandController.getBySlug)