ADD: delete a category by id handler function

This commit is contained in:
MohammadHMazarei
2024-12-29 20:20:22 +03:30
parent bf653737b7
commit 935dace57b
@@ -39,3 +39,12 @@ exports.updateCategory = catchAsync(async (req, res, next) => {
data: category,
})
})
exports.deleteCategory = catchAsync(async (req, res, next) => {
await categoryService.deleteCategory(req.params.categoryId)
res.status(204).json({
status: 'success',
data: null,
})
})