Skip to content
Snippets Groups Projects

Development to testing

Merged Ghost User requested to merge Development into testing
1 file
+ 1
0
Compare changes
  • Side-by-side
  • Inline
@@ -110,13 +110,9 @@ export class FactionService {
@@ -110,13 +110,9 @@ export class FactionService {
});
});
}
}
async joinGroup(person, gameId, data: JoinGameGroupDTO) {
async joinGroup(gameperson, data: JoinGameGroupDTO) {
const gamePerson = await this.game_PersonRepository.findOne({
gameperson.group = data.groupId;
person: person,
await this.game_PersonRepository.save(gameperson);
game: gameId,
});
gamePerson.group = data.groupId;
await this.game_PersonRepository.save(gamePerson);
return {
return {
message: 'Joined group',
message: 'Joined group',
};
};
@@ -138,12 +134,16 @@ export class FactionService {
@@ -138,12 +134,16 @@ export class FactionService {
where: { person, game },
where: { person, game },
relations: ['faction'],
relations: ['faction'],
});
});
if (gameperson) {
if (gameperson.faction) {
return {
return {
message: gameperson,
factionId: gameperson.faction.factionId,
 
factionName: gameperson.faction.factionName,
};
};
} else {
} else {
throw new HttpException('No faction was found', HttpStatus.BAD_REQUEST);
throw new HttpException(
 
gameperson ? 'You are admin for this game!' : 'No faction was found',
 
HttpStatus.BAD_REQUEST,
 
);
}
}
}
}
}
}
Loading