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:
parent
a992868eb6
commit
2640ebbc70
@ -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");
|
||||
|
Loading…
x
Reference in New Issue
Block a user