From c1886ff1dca17f171e0648ad66744d2a8ce37b96 Mon Sep 17 00:00:00 2001 From: David Mehren Date: Sat, 3 Oct 2020 15:53:30 +0200 Subject: [PATCH] NotesController: Add `PUT :noteIdOrAlias/metadata` route Signed-off-by: David Mehren Co-authored-by: Yannick Bungers --- src/api/public/notes/notes.controller.ts | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/api/public/notes/notes.controller.ts b/src/api/public/notes/notes.controller.ts index fc3c7690e..79137ce35 100644 --- a/src/api/public/notes/notes.controller.ts +++ b/src/api/public/notes/notes.controller.ts @@ -9,6 +9,7 @@ import { Put, } from '@nestjs/common'; import { ConsoleLoggerService } from '../../../logger/console-logger.service'; +import { NoteMetadataUpdateDto } from '../../../notes/note-metadata.dto'; import { NotePermissionsUpdateDto } from '../../../notes/note-permissions.dto'; import { NotesService } from '../../../notes/notes.service'; import { RevisionsService } from '../../../revisions/revisions.service'; @@ -21,7 +22,7 @@ export class NotesController { private noteService: NotesService, private revisionsService: RevisionsService, ) { - this.logger.setContext(NotesController.name); + this.logger.setContext(NotesController.name); } @Post() @@ -72,6 +73,14 @@ export class NotesController { return this.noteService.getNoteMetadata(noteIdOrAlias); } + @Put(':noteIdOrAlias/metadata') + updateNoteMetadata( + @Param('noteIdOrAlias') noteIdOrAlias: string, + @Body() updateDto: NoteMetadataUpdateDto, + ) { + return this.noteService.updateNoteMetadata(noteIdOrAlias, updateDto); + } + @Put(':noteIdOrAlias/permissions') updateNotePermissions( @Param('noteIdOrAlias') noteIdOrAlias: string,