10 lines
366 B
TypeScript
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 };
|
|
}
|