diff --git a/src/api/private/notes/notes.controller.ts b/src/api/private/notes/notes.controller.ts index 59b95dbc0..f482ef6b6 100644 --- a/src/api/private/notes/notes.controller.ts +++ b/src/api/private/notes/notes.controller.ts @@ -20,6 +20,7 @@ import { SessionGuard } from '../../../identity/session.guard'; import { ConsoleLoggerService } from '../../../logger/console-logger.service'; import { MediaUploadDto } from '../../../media/media-upload.dto'; import { MediaService } from '../../../media/media.service'; +import { NoteMetadataDto } from '../../../notes/note-metadata.dto'; import { NoteDto } from '../../../notes/note.dto'; import { Note } from '../../../notes/note.entity'; import { NoteMediaDeletionDto } from '../../../notes/note.media-deletion.dto'; @@ -127,6 +128,16 @@ export class NotesController { return; } + @UseInterceptors(GetNoteInterceptor) + @Permissions(Permission.READ) + @Get(':noteIdOrAlias/metadata') + async getNoteMetadata( + @RequestUser() user: User, + @RequestNote() note: Note, + ): Promise { + return await this.noteService.toNoteMetadataDto(note); + } + @Get(':noteIdOrAlias/revisions') @OpenApi(200, 404) @Permissions(Permission.READ)