UNPKG

ecommerce-express-utils

Version:

A collection of handy express utilities for ecommerce

32 lines (23 loc) 620 B
import { getAllBrands, setBrand, updateBrand, getSingleBrand, archiveBrand, getBrandsWithQuery } from './brandController.js'; function brandRoutes({ router, model }) { router.route('/getAllBrands') .get(getAllBrands({ model })); router.route('/createBrand') .post(setBrand({ model })); router.route('/singleBrand/:id') .get(getSingleBrand({ model })) .patch(updateBrand({ model })); router.route('/archiveBrand/:id') .patch(archiveBrand({ model })); router.route('/getBrandsWithQuery') .get(getBrandsWithQuery({ model })); return router; } export { brandRoutes };