website refactor
This commit is contained in:
@@ -132,12 +132,12 @@ export class LeagueService implements Service {
|
||||
}
|
||||
}
|
||||
|
||||
async getAllLeagues(): Promise<any> {
|
||||
async getAllLeagues(): Promise<Result<AllLeaguesWithCapacityAndScoringDTO, DomainError>> {
|
||||
try {
|
||||
const dto = await this.apiClient.getAllWithCapacityAndScoring();
|
||||
return (dto as any).value || dto;
|
||||
return Result.ok(dto);
|
||||
} catch (error: unknown) {
|
||||
throw error;
|
||||
return Result.err({ type: 'serverError', message: (error as Error).message || 'Failed to fetch leagues' });
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user