From c3dcb4a513f9f022f7f0b916e0409d1a9de33493 Mon Sep 17 00:00:00 2001 From: Anand Chowdhary Date: Sun, 15 Nov 2020 22:46:12 +0530 Subject: [PATCH] :bug: Fix scopes for user, groups routes --- src/modules/groups/groups.controller.ts | 8 ++++---- src/modules/users/users.controller.ts | 10 +++++----- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/modules/groups/groups.controller.ts b/src/modules/groups/groups.controller.ts index 8b4d190ae..e0cc222c7 100644 --- a/src/modules/groups/groups.controller.ts +++ b/src/modules/groups/groups.controller.ts @@ -43,7 +43,7 @@ export class GroupController { } @Get(':groupId') - @Scopes('group-{id}:read-info') + @Scopes('group-{groupId}:read-info') async get( @Param('groupId', ParseIntPipe) id: number, ): Promise> { @@ -52,7 +52,7 @@ export class GroupController { @Patch(':groupId') @AuditLog('update-info') - @Scopes('group-{id}:write-info') + @Scopes('group-{groupId}:write-info') async update( @Body() data: UpdateGroupDto, @Param('groupId', ParseIntPipe) id: number, @@ -62,7 +62,7 @@ export class GroupController { @Put(':groupId') @AuditLog('update-info') - @Scopes('group-{id}:write-info') + @Scopes('group-{groupId}:write-info') async replace( @Body() data: ReplaceGroupDto, @Param('groupId', ParseIntPipe) id: number, @@ -72,7 +72,7 @@ export class GroupController { @Delete(':groupId') @AuditLog('delete') - @Scopes('group-{id}:delete') + @Scopes('group-{groupId}:delete') async remove( @Param('groupId', ParseIntPipe) id: number, ): Promise> { diff --git a/src/modules/users/users.controller.ts b/src/modules/users/users.controller.ts index fd6d69102..5cf1d6e51 100644 --- a/src/modules/users/users.controller.ts +++ b/src/modules/users/users.controller.ts @@ -37,13 +37,13 @@ export class UserController { } @Get(':userId') - @Scopes('user-{id}:read-info') + @Scopes('user-{userId}:read-info') async get(@Param('userId', ParseIntPipe) id: number): Promise> { return this.usersService.getUser(Number(id)); } @Patch(':userId') - @Scopes('user-{id}:write-info') + @Scopes('user-{userId}:write-info') async update( @Param('userId', ParseIntPipe) id: number, @Body() data: UpdateUserDto, @@ -52,7 +52,7 @@ export class UserController { } @Delete(':userId') - @Scopes('user-{id}:deactivate') + @Scopes('user-{userId}:deactivate') async remove( @Param('userId', ParseIntPipe) id: number, ): Promise> { @@ -60,7 +60,7 @@ export class UserController { } @Post(':userId/merge-request') - @Scopes('user-{id}:merge') + @Scopes('user-{userId}:merge') @RateLimit({ points: 10, duration: 60, @@ -74,7 +74,7 @@ export class UserController { } @Post('merge') - @Scopes('user-{id}:merge') + @Scopes('user-{userId}:merge') @RateLimit({ points: 10, duration: 60,