feat: add targetScore and allowTies fields to tournament API routes
This commit is contained in:
@@ -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,
|
||||
},
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user