website refactor
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { LeagueRulebookPageQuery } from '@/lib/page-queries/page-queries/LeagueRulebookPageQuery';
|
||||
import { LeagueRulebookPageQuery } from '@/lib/page-queries/LeagueRulebookPageQuery';
|
||||
import { RulebookTemplate } from '@/templates/RulebookTemplate';
|
||||
import { notFound } from 'next/navigation';
|
||||
|
||||
@@ -17,18 +17,21 @@ export default async function Page({ params }: Props) {
|
||||
|
||||
if (result.isErr()) {
|
||||
const error = result.getError();
|
||||
if (error.type === 'notFound') {
|
||||
if (error === 'notFound') {
|
||||
notFound();
|
||||
}
|
||||
// For serverError, show the template with empty data
|
||||
return <RulebookTemplate viewData={{
|
||||
leagueId,
|
||||
scoringConfig: {
|
||||
gameName: 'Unknown',
|
||||
scoringPresetName: 'Unknown',
|
||||
championships: [],
|
||||
dropPolicySummary: 'Unknown',
|
||||
},
|
||||
gameName: 'Unknown',
|
||||
scoringPresetName: 'Unknown',
|
||||
championshipsCount: 0,
|
||||
sessionTypes: 'None',
|
||||
dropPolicySummary: 'Unknown',
|
||||
hasActiveDropPolicy: false,
|
||||
positionPoints: [],
|
||||
bonusPoints: [],
|
||||
hasBonusPoints: false,
|
||||
}} />;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user