Initial commit of Dance School App

This commit is contained in:
kertenkerem
2026-01-08 00:51:13 +03:00
parent 902fb6e9bb
commit 260dea0713
48 changed files with 7923 additions and 1 deletions

View File

@@ -0,0 +1,32 @@
import { NextResponse } from 'next/server';
import { prisma } from '@/infrastructure/db/prisma';
export async function DELETE(
request: Request,
{ params }: { params: { id: string } }
) {
try {
await prisma.branch.delete({
where: { id: params.id },
});
return NextResponse.json({ success: true });
} catch (error) {
return NextResponse.json({ error: 'Failed' }, { status: 500 });
}
}
export async function PUT(
request: Request,
{ params }: { params: { id: string } }
) {
try {
const json = await request.json();
const branch = await prisma.branch.update({
where: { id: params.id },
data: json,
});
return NextResponse.json(branch);
} catch (error) {
return NextResponse.json({ error: 'Failed' }, { status: 500 });
}
}