Add completed match detail pages
This commit is contained in:
@@ -0,0 +1,9 @@
|
||||
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 };
|
||||
}
|
||||
Reference in New Issue
Block a user