website refactor

This commit is contained in:
2026-01-14 10:51:05 +01:00
parent 4522d41aef
commit 0d89ad027e
291 changed files with 6887 additions and 3685 deletions

View File

@@ -8,7 +8,7 @@ import type { CreateLeagueInputDTO } from '@/lib/types/generated/CreateLeagueInp
/**
* CreateLeagueMutation
*
* Framework-agnostic mutation for league creation.
* Framework-agnostic mutation for creating leagues.
* Can be called from Server Actions or other contexts.
*/
export class CreateLeagueMutation {
@@ -24,12 +24,12 @@ export class CreateLeagueMutation {
this.service = new LeagueService(apiClient);
}
async createLeague(input: CreateLeagueInputDTO): Promise<Result<void, string>> {
async execute(input: CreateLeagueInputDTO): Promise<Result<string, string>> {
try {
await this.service.createLeague(input);
return Result.ok(undefined);
const result = await this.service.createLeague(input);
return Result.ok(result.leagueId);
} catch (error) {
console.error('createLeague failed:', error);
console.error('CreateLeagueMutation failed:', error);
return Result.err('Failed to create league');
}
}