feat: add endpoint to get all episodes by media
All checks were successful
Integration Tests / integration-tests (pull_request) Successful in 57s

This commit is contained in:
2026-02-04 23:31:12 +07:00
parent d6fa5efaff
commit c1f90c40f2
4 changed files with 67 additions and 0 deletions

View File

@ -0,0 +1,22 @@
import { Context } from "elysia";
import { mainErrorHandler } from "../../../helpers/error/handler";
import { returnReadResponse } from "../../../helpers/callback/httpResponse";
import { getAllEpisodeFromSpecificMediaService } from "../services/http/getAllEpisodeFromSpecificMedia.service";
export const getAllEpisodeFromSpecificMediaController = async (
ctx: Context & { params: { mediaSlug: string } },
) => {
try {
const episodesData = await getAllEpisodeFromSpecificMediaService(
ctx.params.mediaSlug,
);
return returnReadResponse(
ctx.set,
200,
"Episodes fetched successfully",
episodesData,
);
} catch (error) {
return mainErrorHandler(ctx.set, error);
}
};