From d4b96da9e35c1eaee73351fb6a941e084ac519d5 Mon Sep 17 00:00:00 2001 From: MohammadHMazarei Date: Sun, 29 Dec 2024 19:56:22 +0330 Subject: [PATCH] ADD: get one category handler --- components/category/categoryController.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/components/category/categoryController.js b/components/category/categoryController.js index c10e476..3ad1278 100644 --- a/components/category/categoryController.js +++ b/components/category/categoryController.js @@ -21,3 +21,12 @@ exports.createCategory = catchAsync(async (req, res, next) => { data: category, }) }) + +exports.getCategory = catchAsync(async (req, res, next) => { + const category = await categoryService.getCategory(req.params.categoryId) + + res.status(200).json({ + status: 'success', + data: category, + }) +})