first commit

This commit is contained in:
2025-09-07 22:57:43 +00:00
commit 3bd542adbf
122 changed files with 45056 additions and 0 deletions

View File

@@ -0,0 +1,29 @@
import { NextResponse } from 'next/server';
import { PrismaClient } from '@/app/generated/prisma';
export async function POST(request: Request) {
const prisma = new PrismaClient();
try {
const body = await request.json();
const id: string | undefined = body?.id;
const approve: boolean | undefined = body?.approve;
if (!id || typeof approve !== 'boolean') {
return NextResponse.json({ error: 'id와 approve(boolean)가 필요합니다' }, { status: 400 });
}
const updated = await prisma.userHandle.update({
where: { id },
data: { isApproved: approve },
select: { id: true, isApproved: true },
});
return NextResponse.json({ ok: true, item: updated });
} catch (e) {
console.error('POST /api/admin/user_handles/approve 오류:', e);
return NextResponse.json({ error: '업데이트 실패' }, { status: 500 });
} finally {
await prisma.$disconnect();
}
}