mirror of
https://github.com/trafficlunar/tomodachi-share.git
synced 2026-06-28 14:44:15 +00:00
refactor: cleanup part 4
This commit is contained in:
parent
f00c998c30
commit
9e36944219
4 changed files with 14 additions and 14 deletions
|
|
@ -5,11 +5,11 @@ import { prisma } from "@/lib/prisma";
|
|||
|
||||
export async function DELETE() {
|
||||
const session = await auth();
|
||||
if (!session) return NextResponse.json({ error: "Unauthorized" }, { status: 401 });
|
||||
if (!session || !session.user) return NextResponse.json({ error: "Unauthorized" }, { status: 401 });
|
||||
|
||||
try {
|
||||
await prisma.user.delete({
|
||||
where: { id: Number(session.user?.id!) },
|
||||
where: { id: Number(session.user.id) },
|
||||
});
|
||||
} catch (error) {
|
||||
console.error("Failed to delete user:", error);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue