mirror of
https://github.com/zoriya/Kyoo.git
synced 2025-05-24 02:02:36 -04:00
18 lines
435 B
TypeScript
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;
|
|
};
|