docs #12

Merged
vivy-agent merged 3 commits from docs into main 2026-02-06 22:30:23 +07:00
4 changed files with 101 additions and 1 deletions
Showing only changes of commit bd66705eae - Show all commits

View File

@ -3,6 +3,38 @@ import { mainErrorHandler } from "../../../helpers/error/handler";
import { returnReadResponse } from "../../../helpers/callback/httpResponse"; import { returnReadResponse } from "../../../helpers/callback/httpResponse";
import { getAllEpisodeFromSpecificMediaService } from "../services/http/getAllEpisodeFromSpecificMedia.service"; 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<Object>}
* 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: <Status Code>,
* message: "<Error Message>",
* error: { ...errorDetails } // Additional error details if available and the env run on development mode
* }
*/
export const getAllEpisodeFromSpecificMediaController = async ( export const getAllEpisodeFromSpecificMediaController = async (
ctx: Context & { params: { mediaSlug: string } }, ctx: Context & { params: { mediaSlug: string } },
) => { ) => {