🚚 chore: move get episode with thumbnile repository file
All checks were successful
Integration Tests / integration-tests (pull_request) Successful in 29s

This commit is contained in:
2026-02-05 21:02:53 +07:00
parent 745fd213f9
commit f3522f6cac
2 changed files with 5 additions and 5 deletions

View File

@ -0,0 +1,34 @@
import { AppError } from "../../../../helpers/error/instances/app";
import { episodeModel } from "../../episode.model";
export const getAllEpisodeWithThumbnailLinkRepository = async (
serviceReferenceId: string,
) => {
try {
return await episodeModel.findMany({
where: {
deletedAt: null,
},
select: {
id: true,
episode: true,
videos: {
where: {
deletedAt: null,
serviceId: serviceReferenceId,
},
select: {
code: true,
service: {
select: {
endpointThumbnail: true,
},
},
},
},
},
});
} catch (error) {
throw new AppError(500, "Failed to get all episode thumbnails", error);
}
};