website cleanup
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { CreateLeagueInputDTO } from '@/lib/types/CreateLeagueInputDTO';
|
||||
import type { CreateLeagueInputDTO } from '@/lib/types/generated/CreateLeagueInputDTO';
|
||||
import { LeagueWizardValidationMessages } from '@/lib/display-objects/LeagueWizardValidationMessages';
|
||||
import { ScoringPresetApplier } from '@/lib/utilities/ScoringPresetApplier';
|
||||
|
||||
@@ -267,21 +267,11 @@ export class LeagueWizardCommandModel {
|
||||
}
|
||||
|
||||
toCreateLeagueCommand(ownerId: string): CreateLeagueInputDTO {
|
||||
let maxMembers: number;
|
||||
|
||||
if (this.structure.mode === 'solo') {
|
||||
maxMembers = this.structure.maxDrivers ?? 0;
|
||||
} else {
|
||||
const teams = this.structure.maxTeams ?? 0;
|
||||
const perTeam = this.structure.driversPerTeam ?? 0;
|
||||
maxMembers = teams * perTeam;
|
||||
}
|
||||
|
||||
return {
|
||||
name: this.basics.name.trim(),
|
||||
description: this.basics.description?.trim() ?? '',
|
||||
isPublic: this.basics.visibility === 'public',
|
||||
maxMembers,
|
||||
// API currently only supports public/private. Treat unlisted as private for now.
|
||||
visibility: this.basics.visibility === 'public' ? 'public' : 'private',
|
||||
ownerId,
|
||||
};
|
||||
}
|
||||
@@ -311,4 +301,4 @@ export class LeagueWizardCommandModel {
|
||||
stewarding: instance.stewarding,
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user