feat: add endpoint to get episode details

This commit is contained in:
2026-02-05 21:47:02 +07:00
parent e3e4df35e2
commit 9dd02d097d
5 changed files with 134 additions and 4 deletions

View File

@ -0,0 +1,15 @@
import { AppError } from "../../../../helpers/error/instances/app";
import { mediaModel } from "../../model";
export const getMediaIdFromSlugRepository = async (slug: string) => {
try {
return await mediaModel.findUnique({
where: { slug },
select: {
id: true,
},
});
} catch (error) {
throw new AppError(500, "Failed to fetch media ID from slug.", error);
}
};