Commit 7eb92860 authored by nanahira's avatar nanahira

Update src/tournament/tournament.service.ts, src/tournament/tournament.controller.ts files

parent e8625f21
Pipeline #39605 passed with stages
in 44 seconds
...@@ -36,9 +36,9 @@ const factory = new RestfulFactory(Tournament, { ...@@ -36,9 +36,9 @@ const factory = new RestfulFactory(Tournament, {
relations: [ relations: [
'participants', 'participants',
'matches', 'matches',
'matches.player1', //'matches.player1',
'matches.player2', //'matches.player2',
'matches.winner', //'matches.winner',
/* /*
'matchTree', 'matchTree',
'matchTree.player1', 'matchTree.player1',
......
...@@ -34,9 +34,9 @@ export class TournamentService extends CrudService(Tournament, { ...@@ -34,9 +34,9 @@ export class TournamentService extends CrudService(Tournament, {
relations: [ relations: [
'participants', 'participants',
'matches', 'matches',
'matches.player1', //'matches.player1',
'matches.player2', //'matches.player2',
'matches.winner', //'matches.winner',
], ],
extraGetQuery: (qb) => { extraGetQuery: (qb) => {
/*qb /*qb
...@@ -71,11 +71,13 @@ export class TournamentService extends CrudService(Tournament, { ...@@ -71,11 +71,13 @@ export class TournamentService extends CrudService(Tournament, {
const result = await this.findOne(id, (qb) => const result = await this.findOne(id, (qb) =>
Tournament.extraQueryForUser(user, qb, this.entityAliasName), Tournament.extraQueryForUser(user, qb, this.entityAliasName),
); );
result.data?.participants?.forEach((p) => if (result.data) {
this.participantService.wipeDeckbuf(user, p, result.data), result.data.participants?.forEach((p) =>
); this.participantService.wipeDeckbuf(user, p, result.data),
if(result.data?.status === TournamentStatus.Ready && !noAnalytics) { );
result.data?.analytics(); if(result.data.status === TournamentStatus.Ready && !noAnalytics) {
result.data.analytics();
}
} }
return result; return result;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment