Skip to content
Snippets Groups Projects
Commit 8763a879 authored by Ronnie Friman's avatar Ronnie Friman
Browse files

fix group create bug

parent 3d0060de
No related branches found
No related tags found
3 merge requests!59Development to master,!54Development to testing,!50Mockdata replay
...@@ -102,12 +102,11 @@ export class FactionService { ...@@ -102,12 +102,11 @@ export class FactionService {
game: gameId, game: gameId,
}); });
// check if the authenticated person already belongs to a group // check if the authenticated person already belongs to a group
if ( let check = await this.game_PersonRepository.findOne({
await this.game_PersonRepository.findOne({ where: { person: person, game: gameId },
group: Not(null), relations: ['group'],
person: person, });
}) if (check.group) {
) {
throw new HttpException( throw new HttpException(
'You already belong to a group!', 'You already belong to a group!',
HttpStatus.BAD_REQUEST, HttpStatus.BAD_REQUEST,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment