mirror of
https://github.com/pawelmalak/flame.git
synced 2024-12-22 01:31:30 +03:00
24 lines
478 B
JavaScript
24 lines
478 B
JavaScript
const express = require('express');
|
|
const router = express.Router();
|
|
|
|
const {
|
|
createCategory,
|
|
getAllCategories,
|
|
getSingleCategory,
|
|
updateCategory,
|
|
deleteCategory,
|
|
reorderCategories,
|
|
} = require('../controllers/categories');
|
|
|
|
router.route('/').post(createCategory).get(getAllCategories);
|
|
|
|
router
|
|
.route('/:id')
|
|
.get(getSingleCategory)
|
|
.put(updateCategory)
|
|
.delete(deleteCategory);
|
|
|
|
router.route('/0/reorder').put(reorderCategories);
|
|
|
|
module.exports = router;
|