diff --git a/src/faction/faction.service.ts b/src/faction/faction.service.ts index bcaf4af49583471f614cad9287d4130c5a67aadf..4a574baa552ac205b509a50edc75c50072663410 100644 --- a/src/faction/faction.service.ts +++ b/src/faction/faction.service.ts @@ -102,12 +102,11 @@ export class FactionService { game: gameId, }); // check if the authenticated person already belongs to a group - if ( - await this.game_PersonRepository.findOne({ - group: Not(null), - person: person, - }) - ) { + let check = await this.game_PersonRepository.findOne({ + where: { person: person, game: gameId }, + relations: ['group'], + }); + if (check.group) { throw new HttpException( 'You already belong to a group!', HttpStatus.BAD_REQUEST,