mirror of
https://git.atakanozban.com/Songs2VID/songs2vid.git
synced 2026-11-14 21:29:49 +01:00
15 lines
393 B
TypeScript
15 lines
393 B
TypeScript
|
|
import { NextResponse } from "next/server";
|
||
|
|
import { prisma } from "@/lib/db";
|
||
|
|
import { getSessionUser } from "@/lib/session";
|
||
|
|
|
||
|
|
export async function POST() {
|
||
|
|
const user = await getSessionUser();
|
||
|
|
if (!user) {
|
||
|
|
return NextResponse.json({ error: "Unauthorized" }, { status: 401 });
|
||
|
|
}
|
||
|
|
|
||
|
|
await prisma.user.delete({ where: { id: user.id } });
|
||
|
|
|
||
|
|
return NextResponse.json({ ok: true });
|
||
|
|
}
|