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

added listFactionMembers service&route

parent 0fba8f4b
No related branches found
No related tags found
4 merge requests!59Development to master,!31Development,!26Piirto2,!25Dto service
......@@ -58,6 +58,11 @@ export class GameController {
return this.gameservice.joinGroup(person, id);
}
@Get('get-faction-members/:id')
async getFactionMembers(@Param('id') factionId) {
return this. gameservice.listFactionMembers(factionId)
}
// param game ID is passed to @Roles
@Put('promote/:id')
@UseGuards(new AuthGuard())
......
......@@ -34,7 +34,7 @@ export class GameService {
ObjectivePoint_HistoryEntity
>,
private notificationGateway: NotificationGateway,
) {}
) { }
// create a new game
async createNewGame(personId: PersonEntity, gameData: GameDTO) {
......@@ -228,6 +228,14 @@ export class GameService {
this.notificationGateway.server.emit('flagbox', 'event update');
}
async listFactionMembers(faction) {
return await this.game_PersonRepository.find({
where: {faction},
relations: ["person"],
order: {person: "DESC"},
})
}
async promotePlayer(body) {
const gamepersonId = body.player;
// get playerdata
......
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