ADD: create a new category handler
This commit is contained in:
@@ -12,3 +12,12 @@ exports.getAllCategories = catchAsync(async (req, res, next) => {
|
||||
data: categories,
|
||||
})
|
||||
})
|
||||
|
||||
exports.createCategory = catchAsync(async (req, res, next) => {
|
||||
const category = await categoryService.createCategory(req.body)
|
||||
|
||||
res.status(201).json({
|
||||
status: 'success',
|
||||
data: category,
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user