website refactor

This commit is contained in:
2026-01-16 01:32:55 +01:00
parent a98e3e3166
commit b533de8486
23 changed files with 651 additions and 159 deletions

View File

@@ -1,6 +1,6 @@
import { PageQuery } from '@/lib/contracts/page-queries/PageQuery';
import { Result } from '@/lib/contracts/Result';
import { LeagueService } from '@/lib/services/leagues/LeagueService';
import { LeagueService, type LeagueDetailData } from '@/lib/services/leagues/LeagueService';
import { type PresentationError, mapToPresentationError } from '@/lib/contracts/page-queries/PresentationError';
/**
@@ -8,8 +8,8 @@ import { type PresentationError, mapToPresentationError } from '@/lib/contracts/
* Returns the raw API DTO for the league detail page
* No DI container usage - constructs dependencies explicitly
*/
export class LeagueDetailPageQuery implements PageQuery<unknown, string, PresentationError> {
async execute(leagueId: string): Promise<Result<unknown, PresentationError>> {
export class LeagueDetailPageQuery implements PageQuery<LeagueDetailData, string, PresentationError> {
async execute(leagueId: string): Promise<Result<LeagueDetailData, PresentationError>> {
const service = new LeagueService();
const result = await service.getLeagueDetailData(leagueId);
@@ -21,7 +21,7 @@ export class LeagueDetailPageQuery implements PageQuery<unknown, string, Present
}
// Static method to avoid object construction in server code
static async execute(leagueId: string): Promise<Result<unknown, PresentationError>> {
static async execute(leagueId: string): Promise<Result<LeagueDetailData, PresentationError>> {
const query = new LeagueDetailPageQuery();
return query.execute(leagueId);
}