flame/routes/category.js

28 lines
471 B
JavaScript
Raw Normal View History

2021-05-22 20:04:34 +03:00
const express = require('express');
const router = express.Router();
const {
createCategory,
getCategories,
getCategory,
updateCategory,
deleteCategory,
reorderCategories
2021-05-22 20:04:34 +03:00
} = require('../controllers/category');
router
.route('/')
.post(createCategory)
.get(getCategories);
router
.route('/:id')
.get(getCategory)
.put(updateCategory)
.delete(deleteCategory);
router
.route('/0/reorder')
.put(reorderCategories);
2021-05-22 20:04:34 +03:00
module.exports = router;