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 { ...@@ -156,16 +156,14 @@ export class FactionService {
where: { person, game }, where: { person, game },
relations: ['faction'], relations: ['faction'],
}); });
if (gameperson.faction) { if (gameperson && gameperson.faction) {
return { return {
factionId: gameperson.faction.factionId, factionId: gameperson.faction.factionId,
factionName: gameperson.faction.factionName, factionName: gameperson.faction.factionName,
role: gameperson.role,
}; };
} else { } else {
throw new HttpException( return gameperson ? { role: gameperson.role } : { role: '' };
gameperson ? 'You are admin for this game!' : 'No faction was found',
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