fix(public/notes-controller): extract canEdit parameter from body

Signed-off-by: David Mehren <git@herrmehren.de>
This commit is contained in:
David Mehren 2022-09-18 18:20:32 +02:00 committed by Yannick Bungers
parent 976e5671fa
commit ebb8b10804

View file

@ -268,7 +268,7 @@ export class NotesController {
@RequestUser() user: User, @RequestUser() user: User,
@RequestNote() note: Note, @RequestNote() note: Note,
@Param('userName') username: string, @Param('userName') username: string,
@Body() canEdit: boolean, @Body('canEdit') canEdit: boolean,
): Promise<NotePermissionsDto> { ): Promise<NotePermissionsDto> {
const permissionUser = await this.userService.getUserByUsername(username); const permissionUser = await this.userService.getUserByUsername(username);
const returnedNote = await this.permissionService.setUserPermission( const returnedNote = await this.permissionService.setUserPermission(
@ -321,7 +321,7 @@ export class NotesController {
@OpenApi( @OpenApi(
{ {
code: 200, code: 200,
description: 'Set the permissions for a user on a note', description: 'Set the permissions for a group on a note',
dto: NotePermissionsDto, dto: NotePermissionsDto,
}, },
403, 403,
@ -331,7 +331,7 @@ export class NotesController {
@RequestUser() user: User, @RequestUser() user: User,
@RequestNote() note: Note, @RequestNote() note: Note,
@Param('groupName') groupName: string, @Param('groupName') groupName: string,
@Body() canEdit: boolean, @Body('canEdit') canEdit: boolean,
): Promise<NotePermissionsDto> { ): Promise<NotePermissionsDto> {
const permissionGroup = await this.groupService.getGroupByName(groupName); const permissionGroup = await this.groupService.getGroupByName(groupName);
const returnedNote = await this.permissionService.setGroupPermission( const returnedNote = await this.permissionService.setGroupPermission(