Files
electric-cherry/src/routes/matches/[id]/+page.server.ts
T
2026-10-01 11:45:23 -04:00

10 lines
366 B
TypeScript

import { error } from '@sveltejs/kit';
import { getMatchDetail } from '$lib/server/fleet/match-history.js';
export function load({ params }: { params: { id: string } }) {
if (!/^[1-9]\d*$/.test(params.id)) error(404, 'Match not found');
const match = getMatchDetail(Number(params.id));
if (!match) error(404, 'Match not found');
return { match };
}