website refactor
This commit is contained in:
@@ -9,9 +9,9 @@ export default async function LeagueLayout({
|
||||
params,
|
||||
}: {
|
||||
children: React.ReactNode;
|
||||
params: { id: string };
|
||||
params: Promise<{ id: string }>;
|
||||
}) {
|
||||
const leagueId = params.id;
|
||||
const { id: leagueId } = await params;
|
||||
|
||||
// Execute PageQuery to get league data
|
||||
const result = await LeagueDetailPageQuery.execute(leagueId);
|
||||
|
||||
@@ -5,12 +5,13 @@ import { LeagueDetailViewDataBuilder } from '@/lib/builders/view-data/LeagueDeta
|
||||
import { ErrorBanner } from '@/ui/ErrorBanner';
|
||||
|
||||
interface Props {
|
||||
params: { id: string };
|
||||
params: Promise<{ id: string }>;
|
||||
}
|
||||
|
||||
export default async function Page({ params }: Props) {
|
||||
const { id } = await params;
|
||||
// Execute the PageQuery
|
||||
const result = await LeagueDetailPageQuery.execute(params.id);
|
||||
const result = await LeagueDetailPageQuery.execute(id);
|
||||
|
||||
// Handle different result types
|
||||
if (result.isErr()) {
|
||||
|
||||
@@ -3,11 +3,11 @@ import { RulebookTemplate } from '@/templates/RulebookTemplate';
|
||||
import { notFound } from 'next/navigation';
|
||||
|
||||
interface Props {
|
||||
params: { id: string };
|
||||
params: Promise<{ id: string }>;
|
||||
}
|
||||
|
||||
export default async function Page({ params }: Props) {
|
||||
const leagueId = params.id;
|
||||
const { id: leagueId } = await params;
|
||||
|
||||
if (!leagueId) {
|
||||
notFound();
|
||||
|
||||
@@ -3,11 +3,11 @@ import { LeagueScheduleTemplate } from '@/templates/LeagueScheduleTemplate';
|
||||
import { notFound } from 'next/navigation';
|
||||
|
||||
interface Props {
|
||||
params: { id: string };
|
||||
params: Promise<{ id: string }>;
|
||||
}
|
||||
|
||||
export default async function LeagueSchedulePage({ params }: Props) {
|
||||
const leagueId = params.id;
|
||||
const { id: leagueId } = await params;
|
||||
|
||||
if (!leagueId) {
|
||||
notFound();
|
||||
|
||||
@@ -3,11 +3,11 @@ import { LeagueSettingsTemplate } from '@/templates/LeagueSettingsTemplate';
|
||||
import { notFound } from 'next/navigation';
|
||||
|
||||
interface Props {
|
||||
params: { id: string };
|
||||
params: Promise<{ id: string }>;
|
||||
}
|
||||
|
||||
export default async function LeagueSettingsPage({ params }: Props) {
|
||||
const leagueId = params.id;
|
||||
const { id: leagueId } = await params;
|
||||
|
||||
if (!leagueId) {
|
||||
notFound();
|
||||
|
||||
@@ -3,11 +3,11 @@ import { LeagueSponsorshipsTemplate } from '@/templates/LeagueSponsorshipsTempla
|
||||
import { notFound } from 'next/navigation';
|
||||
|
||||
interface Props {
|
||||
params: { id: string };
|
||||
params: Promise<{ id: string }>;
|
||||
}
|
||||
|
||||
export default async function LeagueSponsorshipsPage({ params }: Props) {
|
||||
const leagueId = params.id;
|
||||
const { id: leagueId } = await params;
|
||||
|
||||
if (!leagueId) {
|
||||
notFound();
|
||||
|
||||
@@ -3,11 +3,11 @@ import { LeagueStandingsTemplate } from '@/templates/LeagueStandingsTemplate';
|
||||
import { notFound } from 'next/navigation';
|
||||
|
||||
interface Props {
|
||||
params: { id: string };
|
||||
params: Promise<{ id: string }>;
|
||||
}
|
||||
|
||||
export default async function Page({ params }: Props) {
|
||||
const leagueId = params.id;
|
||||
const { id: leagueId } = await params;
|
||||
|
||||
if (!leagueId) {
|
||||
notFound();
|
||||
|
||||
@@ -3,11 +3,11 @@ import { StewardingPageClient } from './StewardingPageClient';
|
||||
import { notFound } from 'next/navigation';
|
||||
|
||||
interface Props {
|
||||
params: { id: string };
|
||||
params: Promise<{ id: string }>;
|
||||
}
|
||||
|
||||
export default async function LeagueStewardingPage({ params }: Props) {
|
||||
const leagueId = params.id;
|
||||
const { id: leagueId } = await params;
|
||||
|
||||
if (!leagueId) {
|
||||
notFound();
|
||||
|
||||
Reference in New Issue
Block a user