feat: add tournament creation wizard with participant management and bulk game entry

This commit is contained in:
2026-03-29 19:58:15 -07:00
parent eb381d928c
commit 54fd6abb5e
10 changed files with 984 additions and 97 deletions
+32
View File
@@ -0,0 +1,32 @@
import { NextRequest, NextResponse } from "next/server";
import { prisma } from "@/lib/prisma";
export async function GET(request: NextRequest) {
try {
const { searchParams } = new URL(request.nextUrl);
const query = searchParams.get("q");
if (!query || query.length < 2) {
return NextResponse.json({ players: [] });
}
// Search for players by name (case-insensitive, partial match)
const players = await prisma.player.findMany({
where: {
name: {
contains: query,
},
},
orderBy: { name: "asc" },
take: 20,
});
return NextResponse.json({ players });
} catch (error) {
console.error("Player search error:", error);
return NextResponse.json(
{ error: "Failed to search players" },
{ status: 500 }
);
}
}