UI & API Menu PPID, Submenu Struktur PPID
This commit is contained in:
33
src/app/api/[[...slugs]]/_lib/user/role/index.ts
Normal file
33
src/app/api/[[...slugs]]/_lib/user/role/index.ts
Normal file
@@ -0,0 +1,33 @@
|
||||
import Elysia, { t } from "elysia";
|
||||
import roleCreate from "./create";
|
||||
import roleDelete from "./del";
|
||||
import roleFindMany from "./findMany";
|
||||
import roleFindUnique from "./findUnique";
|
||||
import roleUpdate from "./updt";
|
||||
|
||||
const Role = new Elysia({
|
||||
prefix: "/api/role",
|
||||
tags: ["User / Role"],
|
||||
})
|
||||
|
||||
.post("/create", roleCreate, {
|
||||
body: t.Object({
|
||||
name: t.String(),
|
||||
}),
|
||||
})
|
||||
|
||||
.get("/findMany", roleFindMany)
|
||||
.get("/:id", async (context) => {
|
||||
const response = await roleFindUnique(
|
||||
new Request(context.request)
|
||||
);
|
||||
return response;
|
||||
})
|
||||
.put("/:id", roleUpdate, {
|
||||
body: t.Object({
|
||||
name: t.String(),
|
||||
}),
|
||||
})
|
||||
.delete("/del/:id", roleDelete);
|
||||
|
||||
export default Role;
|
||||
Reference in New Issue
Block a user