From 01da9d6fb9d452fe9e00ce6585ecd59a6b68fb91 Mon Sep 17 00:00:00 2001 From: Ronnie Friman <L4168@student.jamk.fi> Date: Sat, 6 Jul 2019 15:22:49 +0300 Subject: [PATCH] added delete-game path --- src/game/game.controller.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/game/game.controller.ts b/src/game/game.controller.ts index 24d42bb..8d7494b 100644 --- a/src/game/game.controller.ts +++ b/src/game/game.controller.ts @@ -9,6 +9,7 @@ import { Put, UseInterceptors, ClassSerializerInterceptor, + Delete, } from '@nestjs/common'; import { GameService } from './game.service'; @@ -39,6 +40,13 @@ export class GameController { return this.gameservice.editGame(id, body); } + @Delete('delete/:id') + @Roles('admin') + @GameStates('CREATED') + async deleteGame(@Param('id') id: string) { + return this.gameservice.deleteGame(id); + } + @Put('edit-state/:id') @Roles('admin') @UsePipes(new ValidationPipe()) -- GitLab