Skip to content

Commit

Permalink
rollback schema defs for disc insert/delete routes
Browse files Browse the repository at this point in the history
  • Loading branch information
cdleveille committed Jun 9, 2024
1 parent e41c45e commit b58074c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 21 deletions.
Binary file modified bun.lockb
Binary file not shown.
30 changes: 9 additions & 21 deletions src/controllers/disc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,29 +43,17 @@ export const initDiscRoutes = (app: Elysia) => {
);

/* Insert discs (bearer auth secured) */
app.post(
"/disc",
async ({ request }) => {
assertIsRequestAuthorized(request);
const discs = (await Bun.readableStreamToJSON(request.body)) as IDisc[];
return await Disc.insertMany(discs);
},
{
type: "application/json"
}
);
app.post("/disc", async ({ request }) => {
assertIsRequestAuthorized(request);
const discs = (await Bun.readableStreamToJSON(request.body)) as IDisc[];
return await Disc.insertMany(discs);
});

/* Delete all discs (bearer auth secured) */
app.delete(
"/disc",
async ({ request }) => {
assertIsRequestAuthorized(request);
return await Disc.deleteMany();
},
{
type: "application/json"
}
);
app.delete("/disc", async ({ request }) => {
assertIsRequestAuthorized(request);
return await Disc.deleteMany();
});

/* Delete disc by id (bearer auth secured) */
app.delete(
Expand Down

0 comments on commit b58074c

Please sign in to comment.