Skip to content

Commit

Permalink
Move org check to Match itself
Browse files Browse the repository at this point in the history
  • Loading branch information
DarkView committed Dec 16, 2024
1 parent bf05d41 commit aa47faf
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
6 changes: 1 addition & 5 deletions src/controller/MatchController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,10 @@ export class MatchController {
}
const newMatch = new Match(data);

if (process.env.USE_BACKEND === "true") {
newMatch.organizationId = data.organizationId || "";
}

this.matches[data.groupCode] = newMatch;
this.eventNumbers[data.groupCode] = 0;
this.startOutgoingSendLoop();
Log.info(`New match "${newMatch.groupCode}" registered!`);
this.startOutgoingSendLoop();
return true;
} catch (e) {
Log.info(`Failed to create match with group code ${data.groupCode}, ${e}`);
Expand Down
5 changes: 5 additions & 0 deletions src/model/Match.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,11 @@ export class Match {

this.teams.push(firstTeam);
this.teams.push(secondTeam);

if (process.env.USE_BACKEND === "true") {
this.organizationId = data.organizationId || "";
Log.info(`Match ${this.groupCode} created with organization ${this.organizationId}`);
}
}

async receiveMatchSpecificData(data: IAuthedData) {
Expand Down

0 comments on commit aa47faf

Please sign in to comment.