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