mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2024-11-26 03:33:58 -05:00
feat(private-api): add get note metadata call
Signed-off-by: Philip Molares <philip.molares@udo.edu>
This commit is contained in:
parent
aad7ddb836
commit
ccacbd22b2
1 changed files with 11 additions and 0 deletions
|
@ -20,6 +20,7 @@ import { SessionGuard } from '../../../identity/session.guard';
|
||||||
import { ConsoleLoggerService } from '../../../logger/console-logger.service';
|
import { ConsoleLoggerService } from '../../../logger/console-logger.service';
|
||||||
import { MediaUploadDto } from '../../../media/media-upload.dto';
|
import { MediaUploadDto } from '../../../media/media-upload.dto';
|
||||||
import { MediaService } from '../../../media/media.service';
|
import { MediaService } from '../../../media/media.service';
|
||||||
|
import { NoteMetadataDto } from '../../../notes/note-metadata.dto';
|
||||||
import { NoteDto } from '../../../notes/note.dto';
|
import { NoteDto } from '../../../notes/note.dto';
|
||||||
import { Note } from '../../../notes/note.entity';
|
import { Note } from '../../../notes/note.entity';
|
||||||
import { NoteMediaDeletionDto } from '../../../notes/note.media-deletion.dto';
|
import { NoteMediaDeletionDto } from '../../../notes/note.media-deletion.dto';
|
||||||
|
@ -127,6 +128,16 @@ export class NotesController {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@UseInterceptors(GetNoteInterceptor)
|
||||||
|
@Permissions(Permission.READ)
|
||||||
|
@Get(':noteIdOrAlias/metadata')
|
||||||
|
async getNoteMetadata(
|
||||||
|
@RequestUser() user: User,
|
||||||
|
@RequestNote() note: Note,
|
||||||
|
): Promise<NoteMetadataDto> {
|
||||||
|
return await this.noteService.toNoteMetadataDto(note);
|
||||||
|
}
|
||||||
|
|
||||||
@Get(':noteIdOrAlias/revisions')
|
@Get(':noteIdOrAlias/revisions')
|
||||||
@OpenApi(200, 404)
|
@OpenApi(200, 404)
|
||||||
@Permissions(Permission.READ)
|
@Permissions(Permission.READ)
|
||||||
|
|
Loading…
Reference in a new issue