Kyoo/api/tests/helpers/series-helper.ts
2025-01-30 20:03:42 +01:00

18 lines
435 B
TypeScript

import { buildUrl } from "tests/utils";
import { app } from "~/elysia";
import type { SeedSerie } from "~/models/serie";
export const createSerie = async (serie: SeedSerie) => {
const resp = await app.handle(
new Request(buildUrl("series"), {
method: "POST",
body: JSON.stringify(serie),
headers: {
"Content-Type": "application/json",
},
}),
);
const body = await resp.json();
return [resp, body] as const;
};