mirror of
https://github.com/zoriya/Kyoo.git
synced 2026-05-20 22:32:30 -04:00
Update test helpers
This commit is contained in:
@@ -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),
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user