From 2640ebbc70c91abbb1b01da7d7386ef0c4fe654a Mon Sep 17 00:00:00 2001 From: Mathis Date: Thu, 25 Apr 2024 16:31:33 +0200 Subject: [PATCH] feat(controllers): add detailed comment to `getBySlugCategory` function The `getBySlugCategory` function in `category.controller.ts` now has a detailed comment. The comment includes a description of the function, its parameters, and its return value. Signed-off-by: Mathis --- src/controllers/category.controller.ts | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/controllers/category.controller.ts b/src/controllers/category.controller.ts index 967f70f..fe603bd 100644 --- a/src/controllers/category.controller.ts +++ b/src/controllers/category.controller.ts @@ -118,7 +118,15 @@ async function getAllCategory(res: Response): Promise { }); } -async function getBySlugCategory(req: Request, res:Response) { +/** + * Get category by slug + * + * @param {Request} req - The request object containing category slug + * @param {Response} res - The response object to send back the category + * + * @return {Promise} - The response with category data or error message + */ +async function getBySlugCategory(req: Request, res:Response): Promise { const categorySlug = req.params["categorySlug"]; if (!categorySlug) { logger.error("Category slug is missing");