refactor
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import type { ChampionshipConfig } from '../types/ChampionshipConfig';
|
||||
import type { ParticipantRef } from '../types/ParticipantRef';
|
||||
import { ChampionshipStanding } from '../entities/ChampionshipStanding';
|
||||
import { ChampionshipStanding } from '../entities/championship/ChampionshipStanding';
|
||||
import type { ParticipantEventPoints } from './EventScoringService';
|
||||
import { DropScoreApplier, type EventPointsEntry } from './DropScoreApplier';
|
||||
|
||||
@@ -52,7 +52,7 @@ export class ChampionshipAggregator {
|
||||
const resultsDropped = dropResult.dropped.length;
|
||||
|
||||
standings.push(
|
||||
new ChampionshipStanding({
|
||||
ChampionshipStanding.create({
|
||||
seasonId,
|
||||
championshipId: championship.id,
|
||||
participant,
|
||||
@@ -64,7 +64,7 @@ export class ChampionshipAggregator {
|
||||
);
|
||||
}
|
||||
|
||||
standings.sort((a, b) => b.totalPoints - a.totalPoints);
|
||||
standings.sort((a, b) => b.totalPoints.toNumber() - a.totalPoints.toNumber());
|
||||
|
||||
return standings.map((s, index) => s.withPosition(index + 1));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user