import type { ServiceMethodFactory } from "@ethicdevs/react-monolith";
import type { PipelineServiceDeps } from "./types";
const makeGetRepoPipelineManifest: ServiceMethodFactory<
PipelineServiceDeps,
[string, string],
Promise<string | null>
> = ({ request }) => {
return async (orgSlug: string, repoSlug: string) => {
const p = await request.prisma.pipeline.findFirst({
where: {
repo: {
organization: { slug: orgSlug },
slug: repoSlug,
},
},
orderBy: { createdAt: "desc" },
});
return p?.manifest ?? null;
};
};
export default makeGetRepoPipelineManifest;