tambahan
This commit is contained in:
@@ -2,7 +2,8 @@ import Elysia, { t } from "elysia";
|
||||
import { prisma } from "../lib/prisma";
|
||||
|
||||
const CredentialRoute = new Elysia({
|
||||
prefix: "/credential"
|
||||
prefix: "/credential",
|
||||
tags: ["credential"],
|
||||
})
|
||||
.post("/create", async (ctx) => {
|
||||
const { name, value } = ctx.body
|
||||
@@ -26,7 +27,7 @@ const CredentialRoute = new Elysia({
|
||||
description: 'create credential',
|
||||
}
|
||||
})
|
||||
.get("/list", async (ctx) => {
|
||||
.get("/list", async () => {
|
||||
const list = await prisma.credential.findMany()
|
||||
return {
|
||||
message: "success",
|
||||
@@ -40,7 +41,7 @@ const CredentialRoute = new Elysia({
|
||||
})
|
||||
.delete("/rm", async (ctx) => {
|
||||
const { id } = ctx.body
|
||||
const rm = await prisma.credential.delete({
|
||||
await prisma.credential.delete({
|
||||
where: {
|
||||
id: id
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user