Skip to content
Snippets Groups Projects
Commit 7d2766c4 authored by L4168's avatar L4168
Browse files

updated verifyFaction service

parent 4eea2427
No related branches found
No related tags found
2 merge requests!59Development to master,!48Development
......@@ -156,16 +156,14 @@ export class FactionService {
where: { person, game },
relations: ['faction'],
});
if (gameperson.faction) {
if (gameperson && gameperson.faction) {
return {
factionId: gameperson.faction.factionId,
factionName: gameperson.faction.factionName,
role: gameperson.role,
};
} else {
throw new HttpException(
gameperson ? 'You are admin for this game!' : 'No faction was found',
HttpStatus.BAD_REQUEST,
);
return gameperson ? { role: gameperson.role } : { role: '' };
}
}
}
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