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
...@@ -17,6 +17,7 @@ import { User } from '../user/user.decorator'; ...@@ -17,6 +17,7 @@ import { User } from '../user/user.decorator';
import { GameDTO, FlagboxEventDTO } from './game.dto'; import { GameDTO, FlagboxEventDTO } from './game.dto';
import { ValidationPipe } from '../shared/validation.pipe'; import { ValidationPipe } from '../shared/validation.pipe';
import { Roles } from '../shared/roles.decorator'; import { Roles } from '../shared/roles.decorator';
import { GameEntity } from './game.entity';
@Controller('game') @Controller('game')
export class GameController { export class GameController {
...@@ -48,6 +49,12 @@ export class GameController { ...@@ -48,6 +49,12 @@ export class GameController {
return this.gameservice.returnGameInfo(id); 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') @Get('flag/:id')
async flagboxQuery(@Param('id') id: string) { async flagboxQuery(@Param('id') id: string) {
return this.gameservice.flagboxQuery(id); return this.gameservice.flagboxQuery(id);
......
...@@ -110,6 +110,10 @@ export class GameService { ...@@ -110,6 +110,10 @@ export class GameService {
}; };
} }
async listFactions(game: GameEntity) {
return this.factionRepository.find({ game });
}
async deleteGame(id) { async deleteGame(id) {
// TODO: Delete factions from Faction table associated with the deleted game // TODO: Delete factions from Faction table associated with the deleted game
await this.gameRepository.delete({ id }); 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