x
This commit is contained in:
1 parent
20f43bd58d
commit
1ac727f4e5
10 files changed
+306
-122
No files matched your search
@@ -1,5 +1,6 @@
|
||||
import { Elysia, t } from "elysia";
|
||||
import prisma from "../lib/prisma";
|
||||
import { adminOnly } from "../middleware/auth";
|
||||
|
||||
export const menusRoute = new Elysia({ prefix: "/menus" })
|
||||
.get("/", async () => {
|
||||
@@ -26,6 +27,7 @@ export const menusRoute = new Elysia({ prefix: "/menus" })
|
||||
}
|
||||
return menu;
|
||||
})
|
||||
.use(adminOnly)
|
||||
.post("/", async ({ body, set }) => {
|
||||
try {
|
||||
const { name, items } = body as { name: string; items?: { label: string; url: string; order: number }[] };
|
||||
|
||||
Reference in new issue
Block a user