This commit is contained in:
2025-12-17 14:04:11 +01:00
parent 1ea9c9649f
commit daa4bb6576
238 changed files with 4263 additions and 1752 deletions

View File

@@ -26,8 +26,6 @@ import {
import Card from '@/components/ui/Card';
import Button from '@/components/ui/Button';
import { getAuthService } from '@/lib/auth';
import { getGetDashboardOverviewUseCase } from '@/lib/di-container';
import { DashboardOverviewPresenter } from '@/lib/presenters/DashboardOverviewPresenter';
import type {
DashboardOverviewViewModel,
DashboardFeedItemSummaryViewModel,
@@ -94,10 +92,11 @@ export default async function DashboardPage() {
const currentDriverId = session.user.primaryDriverId ?? '';
const useCase = getGetDashboardOverviewUseCase();
const presenter = new DashboardOverviewPresenter();
await useCase.execute({ driverId: currentDriverId }, presenter);
const viewModel = presenter.getViewModel();
const response = await fetch(`${process.env.NEXT_PUBLIC_API_URL}/races/dashboard/overview?driverId=${currentDriverId}`);
if (!response.ok) {
throw new Error('Failed to fetch dashboard overview');
}
const viewModel: DashboardOverviewViewModel = await response.json();
if (!viewModel) {
return null;