Commit def9654e authored by nanahira's avatar nanahira

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

parent d9a5910d
Pipeline #39602 failed with stages
in 1 minute and 2 seconds
...@@ -22,6 +22,7 @@ export class SrvproService { ...@@ -22,6 +22,7 @@ export class SrvproService {
const res = await this.tournamentService.getTournament( const res = await this.tournamentService.getTournament(
tournamentId, tournamentId,
userId, userId,
true,
); );
res.data?.checkPermission(userId); res.data?.checkPermission(userId);
return new SRVProTournamentDto(res.data); return new SRVProTournamentDto(res.data);
......
...@@ -67,14 +67,16 @@ export class TournamentService extends CrudService(Tournament, { ...@@ -67,14 +67,16 @@ export class TournamentService extends CrudService(Tournament, {
private cmptApiToken = this.config.get<string>('CMPT_API_TOKEN', ''); private cmptApiToken = this.config.get<string>('CMPT_API_TOKEN', '');
async getTournament(id: number, user: MycardUser | number) { async getTournament(id: number, user: MycardUser | number, noAnalytics = false) {
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) => result.data?.participants?.forEach((p) =>
this.participantService.wipeDeckbuf(user, p, result.data), this.participantService.wipeDeckbuf(user, p, result.data),
); );
result.data?.analytics(); if(this.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