From bd66705eae8c5757d803d1031d78d6f3c7b4c87a Mon Sep 17 00:00:00 2001 From: Vivy Bot Date: Fri, 6 Feb 2026 22:28:14 +0700 Subject: [PATCH] =?UTF-8?q?=F0=9F=93=9D=20docs:=20add=20documentation=20fo?= =?UTF-8?q?r=20get=20all=20episodes=20controller?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...tAllEpisodeFromSpecificMedia.controller.ts | 32 +++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/src/modules/episode/controllers/getAllEpisodeFromSpecificMedia.controller.ts b/src/modules/episode/controllers/getAllEpisodeFromSpecificMedia.controller.ts index 6388a85..443a99b 100644 --- a/src/modules/episode/controllers/getAllEpisodeFromSpecificMedia.controller.ts +++ b/src/modules/episode/controllers/getAllEpisodeFromSpecificMedia.controller.ts @@ -3,6 +3,38 @@ import { mainErrorHandler } from "../../../helpers/error/handler"; import { returnReadResponse } from "../../../helpers/callback/httpResponse"; import { getAllEpisodeFromSpecificMediaService } from "../services/http/getAllEpisodeFromSpecificMedia.service"; +/** + * @function getAllEpisodeFromSpecificMediaController + * @description Controller to handle fetching all episodes associated with a specific media slug. + * + * @param {Context & { params: { mediaSlug: string } }} ctx + * The context object containing the request body. + * The params must include: + * - mediaSlug: string - The slug of the media to which the episode belongs. + * + * @example + * Request route: GET /episodes/:mediaSlug + * + * @returns {Promise} + * A response object indicating success or failure. + * Return example: + * { + * success: true, + * status: 200, + * message: "Episodes fetched successfully.", + * data: { ...episodeDetails } // Data returned only if the env run on development mode + * } + * + * @throws {Object} + * An error response object if validation fails or an error occurs during bulk insert operation. + * Return example: + * { + * success: false, + * status: , + * message: "", + * error: { ...errorDetails } // Additional error details if available and the env run on development mode + * } + */ export const getAllEpisodeFromSpecificMediaController = async ( ctx: Context & { params: { mediaSlug: string } }, ) => {