style(api): apply prettier formatting
This commit is contained in:
1 parent
80fef25af3
commit
96fede9fe5
75 files changed
+955
-674
No files matched your search
+14
-12
@@ -5,10 +5,7 @@ import { NestFactory } from '@nestjs/core';
|
||||
import mongoose from 'mongoose';
|
||||
import { readFile } from 'node:fs/promises';
|
||||
import { resolve } from 'node:path';
|
||||
import {
|
||||
ConnectionService,
|
||||
resolveMongoDbName,
|
||||
} from '../connection.service';
|
||||
import { ConnectionService, resolveMongoDbName } from '../connection.service';
|
||||
import type {
|
||||
MatchDocument,
|
||||
MatchGameAssignment,
|
||||
@@ -214,12 +211,16 @@ async function main() {
|
||||
printPlan(options, match, codes, plan);
|
||||
|
||||
if (options.dryRun) {
|
||||
console.log('No writes were made. Re-run with --apply to update MongoDB.');
|
||||
console.log(
|
||||
'No writes were made. Re-run with --apply to update MongoDB.',
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
const now = new Date();
|
||||
const session = await (await connectionService.getConnection()).startSession();
|
||||
const session = await (
|
||||
await connectionService.getConnection()
|
||||
).startSession();
|
||||
try {
|
||||
await session.withTransaction(async () => {
|
||||
await applyTournamentCodeUpdates(plan, now, session);
|
||||
@@ -230,9 +231,9 @@ async function main() {
|
||||
status: 'finished',
|
||||
roundRobinMaxRounds: options.maxRounds,
|
||||
gameSchedule: plan.schedule,
|
||||
tournamentCodeIds: [
|
||||
...plan.usedCodeByOldGameNumber.values(),
|
||||
].map((code) => code._id),
|
||||
tournamentCodeIds: [...plan.usedCodeByOldGameNumber.values()].map(
|
||||
(code) => code._id,
|
||||
),
|
||||
resultPollState: {
|
||||
startedAt: match.resultPollState?.startedAt ?? now,
|
||||
lastPolledAt: now,
|
||||
@@ -423,7 +424,9 @@ function partitionIntoRounds(
|
||||
}
|
||||
|
||||
if (!fillRound(0)) {
|
||||
throw new Error('Could not partition result games into simultaneous rounds.');
|
||||
throw new Error(
|
||||
'Could not partition result games into simultaneous rounds.',
|
||||
);
|
||||
}
|
||||
|
||||
return rounds;
|
||||
@@ -586,8 +589,7 @@ function buildSeriesResults(games: MatchGameResult[]): MatchSeriesResult[] {
|
||||
}
|
||||
return [...bySeries.values()].sort(
|
||||
(left, right) =>
|
||||
left.teamAIndex - right.teamAIndex ||
|
||||
left.teamBIndex - right.teamBIndex,
|
||||
left.teamAIndex - right.teamAIndex || left.teamBIndex - right.teamBIndex,
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user