Delete Await Disconnect & Method API

This commit is contained in:
2025-02-11 12:14:24 +08:00
parent 2a93fa787f
commit 7c1d17079a
22 changed files with 21 additions and 226 deletions

View File

@@ -25,7 +25,5 @@ export async function GET(request: Request) {
},
{ status: 500 }
);
} finally {
await prisma.$disconnect();
}
}
}

View File

@@ -4,12 +4,7 @@ import { NextResponse } from "next/server";
export async function GET(request: Request) {
const method = request.method;
if (method !== "GET") {
return NextResponse.json(
{ success: false, message: "Method not allowed" },
{ status: 405 }
);
}
try {
const data = await prisma.user.count({
where: {
@@ -35,8 +30,6 @@ export async function GET(request: Request) {
{ status: 500 }
)
} finally {
await prisma.$disconnect();
}
}