website refactor
This commit is contained in:
@@ -271,7 +271,7 @@ export class LeagueService {
|
||||
throw new Error(err.code);
|
||||
}
|
||||
|
||||
this.allLeaguesWithCapacityPresenter.present(result.unwrap());
|
||||
await this.allLeaguesWithCapacityPresenter.present(result.unwrap());
|
||||
return this.allLeaguesWithCapacityPresenter.getViewModel();
|
||||
}
|
||||
|
||||
@@ -288,7 +288,7 @@ export class LeagueService {
|
||||
throw new Error(err.code);
|
||||
}
|
||||
|
||||
this.allLeaguesWithCapacityAndScoringPresenter.present(result.unwrap());
|
||||
await this.allLeaguesWithCapacityAndScoringPresenter.present(result.unwrap());
|
||||
return this.allLeaguesWithCapacityAndScoringPresenter.getViewModel();
|
||||
}
|
||||
|
||||
@@ -298,7 +298,7 @@ export class LeagueService {
|
||||
if (result.isErr()) {
|
||||
throw new Error(result.unwrapErr().code);
|
||||
}
|
||||
this.totalLeaguesPresenter.present(result.unwrap());
|
||||
await this.totalLeaguesPresenter.present(result.unwrap());
|
||||
return this.totalLeaguesPresenter.getResponseModel()!;
|
||||
}
|
||||
|
||||
@@ -322,7 +322,7 @@ export class LeagueService {
|
||||
throw new Error(result.unwrapErr().code);
|
||||
}
|
||||
|
||||
this.leagueJoinRequestsPresenter.present(result.unwrap());
|
||||
await this.leagueJoinRequestsPresenter.present(result.unwrap());
|
||||
return this.leagueJoinRequestsPresenter.getViewModel()!.joinRequests;
|
||||
}
|
||||
|
||||
@@ -353,7 +353,7 @@ export class LeagueService {
|
||||
throw new Error(err.code);
|
||||
}
|
||||
|
||||
this.approveLeagueJoinRequestPresenter.present(result.unwrap());
|
||||
await this.approveLeagueJoinRequestPresenter.present(result.unwrap());
|
||||
return this.approveLeagueJoinRequestPresenter.getViewModel()!;
|
||||
}
|
||||
|
||||
@@ -384,7 +384,7 @@ export class LeagueService {
|
||||
throw new Error(err.code);
|
||||
}
|
||||
|
||||
this.rejectLeagueJoinRequestPresenter.present(result.unwrap());
|
||||
await this.rejectLeagueJoinRequestPresenter.present(result.unwrap());
|
||||
return this.rejectLeagueJoinRequestPresenter.getViewModel()!;
|
||||
}
|
||||
|
||||
@@ -415,7 +415,7 @@ export class LeagueService {
|
||||
throw new Error(err.code);
|
||||
}
|
||||
|
||||
this.approveLeagueJoinRequestPresenter.present(result.unwrap());
|
||||
await this.approveLeagueJoinRequestPresenter.present(result.unwrap());
|
||||
return this.approveLeagueJoinRequestPresenter.getViewModel()!;
|
||||
}
|
||||
|
||||
@@ -432,7 +432,7 @@ export class LeagueService {
|
||||
throw new NotFoundException('Join request not found');
|
||||
}
|
||||
|
||||
this.rejectLeagueJoinRequestPresenter.present(result.unwrap());
|
||||
await this.rejectLeagueJoinRequestPresenter.present(result.unwrap());
|
||||
return this.rejectLeagueJoinRequestPresenter.getViewModel()!;
|
||||
}
|
||||
|
||||
@@ -450,7 +450,7 @@ export class LeagueService {
|
||||
throw new Error(result.unwrapErr().code);
|
||||
}
|
||||
|
||||
this.getLeagueAdminPermissionsPresenter.present(result.unwrap());
|
||||
await this.getLeagueAdminPermissionsPresenter.present(result.unwrap());
|
||||
return this.getLeagueAdminPermissionsPresenter.getResponseModel()!;
|
||||
}
|
||||
|
||||
@@ -479,7 +479,7 @@ export class LeagueService {
|
||||
throw new Error(err.code);
|
||||
}
|
||||
|
||||
this.removeLeagueMemberPresenter.present(result.unwrap());
|
||||
await this.removeLeagueMemberPresenter.present(result.unwrap());
|
||||
return this.removeLeagueMemberPresenter.getViewModel()!;
|
||||
}
|
||||
|
||||
@@ -517,7 +517,7 @@ export class LeagueService {
|
||||
throw new Error(err.code);
|
||||
}
|
||||
|
||||
this.updateLeagueMemberRolePresenter.present(result.unwrap());
|
||||
await this.updateLeagueMemberRolePresenter.present(result.unwrap());
|
||||
return this.updateLeagueMemberRolePresenter.getViewModel()!;
|
||||
}
|
||||
|
||||
@@ -527,7 +527,7 @@ export class LeagueService {
|
||||
if (result.isErr()) {
|
||||
throw new Error(result.unwrapErr().code);
|
||||
}
|
||||
this.getLeagueOwnerSummaryPresenter.present(result.unwrap());
|
||||
await this.getLeagueOwnerSummaryPresenter.present(result.unwrap());
|
||||
return this.getLeagueOwnerSummaryPresenter.getViewModel()!;
|
||||
}
|
||||
|
||||
@@ -539,7 +539,7 @@ export class LeagueService {
|
||||
if (result.isErr()) {
|
||||
throw new Error(result.unwrapErr().code);
|
||||
}
|
||||
this.leagueConfigPresenter.present(result.unwrap());
|
||||
await this.leagueConfigPresenter.present(result.unwrap());
|
||||
return this.leagueConfigPresenter.getViewModel();
|
||||
} catch (error) {
|
||||
this.logger.error('Error getting league full config', error instanceof Error ? error : new Error(String(error)));
|
||||
@@ -553,7 +553,7 @@ export class LeagueService {
|
||||
if (result.isErr()) {
|
||||
throw new Error(result.unwrapErr().code);
|
||||
}
|
||||
this.leagueProtestsPresenter.present(result.unwrap());
|
||||
await this.leagueProtestsPresenter.present(result.unwrap());
|
||||
return this.leagueProtestsPresenter.getResponseModel()!;
|
||||
}
|
||||
|
||||
@@ -563,7 +563,7 @@ export class LeagueService {
|
||||
if (result.isErr()) {
|
||||
throw new Error(result.unwrapErr().code);
|
||||
}
|
||||
this.getLeagueSeasonsPresenter.present(result.unwrap());
|
||||
await this.getLeagueSeasonsPresenter.present(result.unwrap());
|
||||
return this.getLeagueSeasonsPresenter.getResponseModel()!;
|
||||
}
|
||||
|
||||
@@ -573,7 +573,7 @@ export class LeagueService {
|
||||
if (result.isErr()) {
|
||||
throw new Error(result.unwrapErr().code);
|
||||
}
|
||||
this.getLeagueMembershipsPresenter.present(result.unwrap());
|
||||
await this.getLeagueMembershipsPresenter.present(result.unwrap());
|
||||
return this.getLeagueMembershipsPresenter.getViewModel()!.memberships;
|
||||
}
|
||||
|
||||
@@ -589,7 +589,7 @@ export class LeagueService {
|
||||
throw new Error(result.unwrapErr().code);
|
||||
}
|
||||
|
||||
this.getLeagueRosterMembersPresenter.present(result.unwrap());
|
||||
await this.getLeagueRosterMembersPresenter.present(result.unwrap());
|
||||
return this.getLeagueRosterMembersPresenter.getViewModel()!;
|
||||
}
|
||||
|
||||
@@ -605,7 +605,7 @@ export class LeagueService {
|
||||
throw new Error(result.unwrapErr().code);
|
||||
}
|
||||
|
||||
this.getLeagueRosterJoinRequestsPresenter.present(result.unwrap());
|
||||
await this.getLeagueRosterJoinRequestsPresenter.present(result.unwrap());
|
||||
return this.getLeagueRosterJoinRequestsPresenter.getViewModel()!;
|
||||
}
|
||||
|
||||
@@ -615,7 +615,7 @@ export class LeagueService {
|
||||
if (result.isErr()) {
|
||||
throw new Error(result.unwrapErr().code);
|
||||
}
|
||||
this.leagueStandingsPresenter.present(result.unwrap());
|
||||
await this.leagueStandingsPresenter.present(result.unwrap());
|
||||
return this.leagueStandingsPresenter.getResponseModel()!;
|
||||
}
|
||||
|
||||
@@ -629,7 +629,7 @@ export class LeagueService {
|
||||
throw new Error(result.unwrapErr().code);
|
||||
}
|
||||
|
||||
this.leagueSchedulePresenter.present(result.unwrap());
|
||||
await this.leagueSchedulePresenter.present(result.unwrap());
|
||||
return this.leagueSchedulePresenter.getViewModel()!;
|
||||
}
|
||||
|
||||
@@ -649,7 +649,7 @@ export class LeagueService {
|
||||
throw new Error(result.unwrapErr().code);
|
||||
}
|
||||
|
||||
this.publishLeagueSeasonSchedulePresenter.present(result.unwrap());
|
||||
await this.publishLeagueSeasonSchedulePresenter.present(result.unwrap());
|
||||
return this.publishLeagueSeasonSchedulePresenter.getResponseModel()!;
|
||||
}
|
||||
|
||||
@@ -669,7 +669,7 @@ export class LeagueService {
|
||||
throw new Error(result.unwrapErr().code);
|
||||
}
|
||||
|
||||
this.unpublishLeagueSeasonSchedulePresenter.present(result.unwrap());
|
||||
await this.unpublishLeagueSeasonSchedulePresenter.present(result.unwrap());
|
||||
return this.unpublishLeagueSeasonSchedulePresenter.getResponseModel()!;
|
||||
}
|
||||
|
||||
@@ -698,7 +698,7 @@ export class LeagueService {
|
||||
throw new Error(result.unwrapErr().code);
|
||||
}
|
||||
|
||||
this.createLeagueSeasonScheduleRacePresenter.present(result.unwrap());
|
||||
await this.createLeagueSeasonScheduleRacePresenter.present(result.unwrap());
|
||||
return this.createLeagueSeasonScheduleRacePresenter.getResponseModel()!;
|
||||
}
|
||||
|
||||
@@ -731,7 +731,7 @@ export class LeagueService {
|
||||
throw new Error(result.unwrapErr().code);
|
||||
}
|
||||
|
||||
this.updateLeagueSeasonScheduleRacePresenter.present(result.unwrap());
|
||||
await this.updateLeagueSeasonScheduleRacePresenter.present(result.unwrap());
|
||||
return this.updateLeagueSeasonScheduleRacePresenter.getResponseModel()!;
|
||||
}
|
||||
|
||||
@@ -749,7 +749,7 @@ export class LeagueService {
|
||||
throw new Error(result.unwrapErr().code);
|
||||
}
|
||||
|
||||
this.deleteLeagueSeasonScheduleRacePresenter.present(result.unwrap());
|
||||
await this.deleteLeagueSeasonScheduleRacePresenter.present(result.unwrap());
|
||||
return this.deleteLeagueSeasonScheduleRacePresenter.getResponseModel()!;
|
||||
}
|
||||
|
||||
@@ -759,7 +759,7 @@ export class LeagueService {
|
||||
if (result.isErr()) {
|
||||
throw new Error(result.unwrapErr().code);
|
||||
}
|
||||
this.leagueStatsPresenter.present(result.unwrap());
|
||||
await this.leagueStatsPresenter.present(result.unwrap());
|
||||
return this.leagueStatsPresenter.getResponseModel()!;
|
||||
}
|
||||
|
||||
@@ -778,13 +778,13 @@ export class LeagueService {
|
||||
}
|
||||
|
||||
// Present the full config result
|
||||
this.leagueConfigPresenter.present(fullConfigResult.unwrap());
|
||||
await this.leagueConfigPresenter.present(fullConfigResult.unwrap());
|
||||
|
||||
const ownerSummaryResult = await this.getLeagueOwnerSummaryUseCase.execute({ leagueId });
|
||||
if (ownerSummaryResult.isErr()) {
|
||||
throw new Error(ownerSummaryResult.unwrapErr().code);
|
||||
}
|
||||
this.getLeagueOwnerSummaryPresenter.present(ownerSummaryResult.unwrap());
|
||||
await this.getLeagueOwnerSummaryPresenter.present(ownerSummaryResult.unwrap());
|
||||
const ownerSummary = this.getLeagueOwnerSummaryPresenter.getViewModel()!;
|
||||
|
||||
const configForm = this.leagueConfigPresenter.getViewModel();
|
||||
@@ -817,7 +817,7 @@ export class LeagueService {
|
||||
if (result.isErr()) {
|
||||
throw new Error(result.unwrapErr().code);
|
||||
}
|
||||
this.createLeaguePresenter.present(result.unwrap());
|
||||
await this.createLeaguePresenter.present(result.unwrap());
|
||||
return this.createLeaguePresenter.getViewModel()!;
|
||||
}
|
||||
|
||||
@@ -829,7 +829,7 @@ export class LeagueService {
|
||||
if (result.isErr()) {
|
||||
throw new Error(result.unwrapErr().code);
|
||||
}
|
||||
this.leagueScoringConfigPresenter.present(result.unwrap());
|
||||
await this.leagueScoringConfigPresenter.present(result.unwrap());
|
||||
return this.leagueScoringConfigPresenter.getViewModel();
|
||||
} catch (error) {
|
||||
this.logger.error('Error getting league scoring config', error instanceof Error ? error : new Error(String(error)));
|
||||
@@ -844,7 +844,7 @@ export class LeagueService {
|
||||
if (result.isErr()) {
|
||||
throw new Error(result.unwrapErr().code);
|
||||
}
|
||||
this.leagueScoringPresetsPresenter.present(result.unwrap());
|
||||
await this.leagueScoringPresetsPresenter.present(result.unwrap());
|
||||
return this.leagueScoringPresetsPresenter.getViewModel()!;
|
||||
}
|
||||
|
||||
@@ -856,7 +856,7 @@ export class LeagueService {
|
||||
if (result.isErr()) {
|
||||
throw new Error(result.unwrapErr().code);
|
||||
}
|
||||
this.joinLeaguePresenter.present(result.unwrap());
|
||||
await this.joinLeaguePresenter.present(result.unwrap());
|
||||
return this.joinLeaguePresenter.getViewModel()!;
|
||||
}
|
||||
|
||||
@@ -877,7 +877,7 @@ export class LeagueService {
|
||||
throw new Error(result.unwrapErr().code);
|
||||
}
|
||||
|
||||
this.transferLeagueOwnershipPresenter.present(result.unwrap());
|
||||
await this.transferLeagueOwnershipPresenter.present(result.unwrap());
|
||||
return this.transferLeagueOwnershipPresenter.getViewModel()!;
|
||||
}
|
||||
|
||||
@@ -888,7 +888,7 @@ export class LeagueService {
|
||||
if (result.isErr()) {
|
||||
throw new Error(result.unwrapErr().code);
|
||||
}
|
||||
this.seasonSponsorshipsPresenter.present(result.unwrap());
|
||||
await this.seasonSponsorshipsPresenter.present(result.unwrap());
|
||||
return this.seasonSponsorshipsPresenter.getViewModel()!;
|
||||
}
|
||||
|
||||
@@ -904,7 +904,7 @@ export class LeagueService {
|
||||
throw new Error(result.unwrapErr().code);
|
||||
}
|
||||
|
||||
this.leagueSchedulePresenter.present(result.unwrap());
|
||||
await this.leagueSchedulePresenter.present(result.unwrap());
|
||||
return {
|
||||
races: this.leagueSchedulePresenter.getViewModel()?.races ?? [],
|
||||
};
|
||||
@@ -916,7 +916,7 @@ export class LeagueService {
|
||||
if (result.isErr()) {
|
||||
throw new Error(result.unwrapErr().code);
|
||||
}
|
||||
this.getLeagueWalletPresenter.present(result.unwrap());
|
||||
await this.getLeagueWalletPresenter.present(result.unwrap());
|
||||
return this.getLeagueWalletPresenter.getResponseModel();
|
||||
}
|
||||
|
||||
@@ -940,7 +940,7 @@ export class LeagueService {
|
||||
throw new Error(result.unwrapErr().code);
|
||||
}
|
||||
|
||||
this.withdrawFromLeagueWalletPresenter.present(result.unwrap());
|
||||
await this.withdrawFromLeagueWalletPresenter.present(result.unwrap());
|
||||
return this.withdrawFromLeagueWalletPresenter.getResponseModel();
|
||||
}
|
||||
}
|
||||
@@ -11,14 +11,17 @@ export class InitializationLogger {
|
||||
}
|
||||
|
||||
log(message: string): void {
|
||||
console.log(`[Initialization] ${message}`);
|
||||
const timestamp = new Date().toISOString();
|
||||
console.log(`[${timestamp}] [Initialization] ${message}`);
|
||||
}
|
||||
|
||||
error(message: string): void {
|
||||
console.error(`[Initialization] ${message}`);
|
||||
const timestamp = new Date().toISOString();
|
||||
console.error(`[${timestamp}] [Initialization] ${message}`);
|
||||
}
|
||||
|
||||
warn(message: string): void {
|
||||
console.warn(`[Initialization] ${message}`);
|
||||
const timestamp = new Date().toISOString();
|
||||
console.warn(`[${timestamp}] [Initialization] ${message}`);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user