.
This commit is contained in:
1 parent
c5d296d403
commit
2250b6072e
22 files changed
+1719
-42
No files matched your search
@@ -92,6 +92,11 @@ export class MatchService {
|
||||
|
||||
public async serialize(match: MatchDocument) {
|
||||
const obj = match.toObject();
|
||||
if (obj.result?.games) {
|
||||
obj.result.games = [...obj.result.games].sort(
|
||||
(left, right) => left.gameNumber - right.gameNumber,
|
||||
);
|
||||
}
|
||||
return {
|
||||
...obj,
|
||||
gameCount: match.gameCount || DEFAULT_TOURNAMENT_GAME_COUNT,
|
||||
@@ -116,6 +121,8 @@ export class MatchService {
|
||||
await this.tournamentCodeService.releaseFromMatch(match);
|
||||
match.tournamentCodeIds = [];
|
||||
match.teamBuiltAt = undefined;
|
||||
match.result = undefined;
|
||||
match.resultPollState = undefined;
|
||||
}
|
||||
await match.save();
|
||||
return match;
|
||||
|
||||
Reference in new issue
Block a user