ADD: create a new category handler

This commit is contained in:
MohammadHMazarei
2024-12-29 19:51:15 +03:30
parent 2fc9cad7fc
commit ed884c405e
@@ -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,
})
})