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, {
relations: [
'participants',
'matches',
'matches.player1',
'matches.player2',
'matches.winner',
//'matches.player1',
//'matches.player2',
//'matches.winner',
/*
'matchTree',
'matchTree.player1',
......
......@@ -34,9 +34,9 @@ export class TournamentService extends CrudService(Tournament, {
relations: [
'participants',
'matches',
'matches.player1',
'matches.player2',
'matches.winner',
//'matches.player1',
//'matches.player2',
//'matches.winner',
],
extraGetQuery: (qb) => {
/*qb
......@@ -71,11 +71,13 @@ export class TournamentService extends CrudService(Tournament, {
const result = await this.findOne(id, (qb) =>
Tournament.extraQueryForUser(user, qb, this.entityAliasName),
);
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) {
result.data.participants?.forEach((p) =>
this.participantService.wipeDeckbuf(user, p, result.data),
);
if(result.data.status === TournamentStatus.Ready && !noAnalytics) {
result.data.analytics();
}
}
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