ADD: delete a category by id handler function
This commit is contained in:
@@ -39,3 +39,12 @@ exports.updateCategory = catchAsync(async (req, res, next) => {
|
|||||||
data: category,
|
data: category,
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
|
exports.deleteCategory = catchAsync(async (req, res, next) => {
|
||||||
|
await categoryService.deleteCategory(req.params.categoryId)
|
||||||
|
|
||||||
|
res.status(204).json({
|
||||||
|
status: 'success',
|
||||||
|
data: null,
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user