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

added listFactions for gm

parent 511334e4
No related branches found
No related tags found
3 merge requests!59Development to master,!31Development,!29Json validation
This commit is part of merge request !29. Comments created here will be created in the context of that merge request.
......@@ -17,6 +17,7 @@ import { User } from '../user/user.decorator';
import { GameDTO, FlagboxEventDTO } from './game.dto';
import { ValidationPipe } from '../shared/validation.pipe';
import { Roles } from '../shared/roles.decorator';
import { GameEntity } from './game.entity';
@Controller('game')
export class GameController {
......@@ -48,6 +49,12 @@ export class GameController {
return this.gameservice.returnGameInfo(id);
}
@Get('get-factions/:id')
@Roles('admin')
async returnGameFactions(@Param('id') id: GameEntity) {
return this.gameservice.listFactions(id);
}
@Get('flag/:id')
async flagboxQuery(@Param('id') id: string) {
return this.gameservice.flagboxQuery(id);
......
......@@ -110,6 +110,10 @@ export class GameService {
};
}
async listFactions(game: GameEntity) {
return this.factionRepository.find({ game });
}
async deleteGame(id) {
// TODO: Delete factions from Faction table associated with the deleted game
await this.gameRepository.delete({ id });
......
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