feat: add targetScore and allowTies fields to tournament API routes

This commit is contained in:
2026-03-30 22:58:01 -07:00
parent 5d1755f082
commit d6a53f8912
2 changed files with 7 additions and 1 deletions
+3 -1
View File
@@ -69,7 +69,7 @@ export async function POST(request: Request) {
}
const body = await request.json();
const { name, format, eventDate } = body;
const { name, format, eventDate, targetScore, allowTies } = body;
const tournament = await prisma.event.create({
data: {
@@ -79,6 +79,8 @@ export async function POST(request: Request) {
eventType: "tournament",
status: "planned",
ownerId: session.user.id, // Assign ownership to the creator
targetScore: targetScore ? parseInt(targetScore) : null,
allowTies: allowTies ?? false,
},
});