website refactor
This commit is contained in:
@@ -1,14 +1,14 @@
|
||||
import { notFound, redirect } from 'next/navigation';
|
||||
import { LeaderboardsPageQuery } from '@/lib/page-queries/page-queries/LeaderboardsPageQuery';
|
||||
import { LeaderboardsPageWrapper } from './LeaderboardsPageWrapper';
|
||||
import { LeaderboardsTemplate } from '@/templates/LeaderboardsTemplate';
|
||||
import { routes } from '@/lib/routing/RouteConfig';
|
||||
|
||||
export default async function LeaderboardsPage() {
|
||||
const result = await LeaderboardsPageQuery.execute();
|
||||
|
||||
|
||||
if (result.isErr()) {
|
||||
const error = result.getError();
|
||||
|
||||
|
||||
// Handle different error types
|
||||
if (error === 'notFound') {
|
||||
notFound();
|
||||
@@ -20,8 +20,8 @@ export default async function LeaderboardsPage() {
|
||||
notFound();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Success
|
||||
const viewData = result.unwrap();
|
||||
return <LeaderboardsPageWrapper data={viewData} />;
|
||||
return <LeaderboardsTemplate viewData={viewData} />;
|
||||
}
|
||||
Reference in New Issue
Block a user