import { createClient } from "@/lib/supabase/server"; import { requireUser } from "@/lib/api/auth"; import { apiError, apiSuccess } from "@/lib/api/errors"; import * as matches from "@/lib/services/matches"; export async function GET( _request: Request, { params }: { params: Promise<{ matchId: string }> } ) { try { const { matchId } = await params; const supabase = await createClient(); await requireUser(supabase); const data = await matches.getMatchDetails(supabase, matchId); return apiSuccess(data); } catch (e) { return apiError(e); } }