Skip to content
Snippets Groups Projects

Join game

Merged Ghost User requested to merge JoinGame into Development
6 files
+ 153
28
Compare changes
  • Side-by-side
  • Inline
Files
6
+ 20
10
@@ -12,9 +12,8 @@ import {
@@ -12,9 +12,8 @@ import {
import { GameService } from './game.service';
import { GameService } from './game.service';
import { AuthGuard } from '../shared/auth.guard';
import { AuthGuard } from '../shared/auth.guard';
import { User } from '../user/user.decorator';
import { User } from '../user/user.decorator';
import { GameDTO } from './game.dto';
import { GameDTO, GameGroupDTO } from './game.dto';
import { ValidationPipe } from '../shared/validation.pipe';
import { ValidationPipe } from '../shared/validation.pipe';
import { Game_PersonEntity } from './game.entity';
import { Roles } from '../shared/roles.decorator';
import { Roles } from '../shared/roles.decorator';
@Controller('game')
@Controller('game')
@@ -35,14 +34,25 @@ export class GameController {
@@ -35,14 +34,25 @@ export class GameController {
return this.gameservice.editGame(id, body);
return this.gameservice.editGame(id, body);
}
}
// @UseGuards(new AuthGuard())
@Post(':id')
// @UsePipes(new ValidationPipe())
@UseGuards(new AuthGuard())
// @Post(':id')
@UsePipes(new ValidationPipe())
// async joinGame(@User('id') person, @Body() data: Game_PersonEntity) {
async createGroup(@User('id') person, @Param('id') id: string, @Body() data: GameGroupDTO) {
// try {
try {
// return this.gameservice.joinGame(person, data, json);
return this.gameservice.createGroup(person, id, data);
// } catch (error) {}
} catch (error) {}
// }
}
 
 
@Get('get-groups')
 
async getGroups() {
 
return this.gameservice.showGroups();
 
}
 
 
@Put('groups/:id')
 
@UseGuards(new AuthGuard())
 
async joinGroup(@User('id') person, @Param('id') id) {
 
return this.gameservice.joinGroup(person, id)
 
}
@Put('joinfaction')
@Put('joinfaction')
@UseGuards(new AuthGuard())
@UseGuards(new AuthGuard())
Loading