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 <yidhra@tuta.io>
This commit is contained in:
Mathis H (Avnyr) 2024-04-25 16:31:33 +02:00
parent a992868eb6
commit 2640ebbc70
Signed by: Mathis
GPG Key ID: DD9E0666A747D126

View File

@ -118,7 +118,15 @@ async function getAllCategory(res: Response): Promise<Response> {
});
}
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<Response>} - The response with category data or error message
*/
async function getBySlugCategory(req: Request, res:Response): Promise<Response> {
const categorySlug = req.params["categorySlug"];
if (!categorySlug) {
logger.error("Category slug is missing");