diff --git a/src/api/api.controller.ts b/src/api/api.controller.ts index ceb3063..2e3df63 100644 --- a/src/api/api.controller.ts +++ b/src/api/api.controller.ts @@ -3,6 +3,7 @@ import { Controller, Delete, Inject, + Param, Post, UseGuards, } from "@nestjs/common"; @@ -28,8 +29,8 @@ export class ApiController { return this.apiService.generateToken(body.id); } - @Delete("token/revoke") - revokeToken(@Body() body: { token: string }) { - return this.apiService.revokeToken(body.token); + @Delete("token/revoke/:token") + revokeToken(@Param("token") token: string) { + return this.apiService.revokeToken(token); } } diff --git a/src/project/project.controller.ts b/src/project/project.controller.ts index 9cb44a1..1cea75a 100644 --- a/src/project/project.controller.ts +++ b/src/project/project.controller.ts @@ -24,6 +24,7 @@ export class ProjectController { ) {} @Put("create") + @UseGuards(AdminGuard) createProject(@Body() body: { name: string }) { return this.projectService.create(body.name); } @@ -63,6 +64,5 @@ export class ProjectController { @UseGuards(AdminGuard) getAllApiTokens(@Req() req: Request & { apiToken: { id: string } }) { return this.projectService.getAllApiTokens(req.apiToken.id); - } - -} + } +}