Add category edit action
This commit is contained in:
@@ -10,7 +10,8 @@ const {
|
||||
getCatalogSummary,
|
||||
listCategories,
|
||||
listConsumptionReferences,
|
||||
listProducts
|
||||
listProducts,
|
||||
updateCategory
|
||||
} = require('../services/catalogService');
|
||||
const { importTinyProductCompositionExport } = require('../services/productionOrderService');
|
||||
|
||||
@@ -40,6 +41,14 @@ router.post('/catalog/categories', verifyToken, async (req, res, next) => {
|
||||
}
|
||||
});
|
||||
|
||||
router.put('/catalog/categories/:id', verifyToken, async (req, res, next) => {
|
||||
try {
|
||||
res.json(await updateCategory(req.params.id, req.body || {}));
|
||||
} catch (error) {
|
||||
next(error);
|
||||
}
|
||||
});
|
||||
|
||||
router.delete('/catalog/categories/:id', verifyToken, async (req, res, next) => {
|
||||
try {
|
||||
await deleteCategory(req.params.id);
|
||||
|
||||
Reference in New Issue
Block a user