Update test helpers

This commit is contained in:
Zoe Roux
2025-01-26 22:15:41 +01:00
parent fabf6b6863
commit e5bb462e36
6 changed files with 40 additions and 16 deletions
+3 -2
View File
@@ -21,12 +21,13 @@ export const videos = new Elysia({ prefix: "/videos", tags: ["videos"] })
})
.post(
"",
async ({ body }) => {
return await db
async ({ body, error }) => {
const ret = await db
.insert(videosT)
.values(body)
.onConflictDoNothing()
.returning({ id: videosT.id, path: videosT.path });
return error(201, ret);
},
{
body: t.Array(SeedVideo),
+1
View File
@@ -36,3 +36,4 @@ export type Video = typeof Video.static;
registerExamples(Video, bubbleVideo);
export const SeedVideo = t.Omit(Video, ["id", "slug", "createdAt"]);
export type SeedVideo = typeof SeedVideo.static;