mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2024-11-27 03:58:02 -05:00
NotesService: Implement getNoteContent
and getNoteMetdata
Signed-off-by: David Mehren <git@herrmehren.de>
This commit is contained in:
parent
8b9a45b738
commit
6e4893d179
1 changed files with 6 additions and 32 deletions
|
@ -164,35 +164,9 @@ export class NotesService {
|
||||||
await this.noteRepository.save(note);
|
await this.noteRepository.save(note);
|
||||||
}
|
}
|
||||||
|
|
||||||
getNoteMetadata(noteIdOrAlias: string): NoteMetadataDto {
|
async getNoteMetadata(noteIdOrAlias: string): Promise<NoteMetadataDto> {
|
||||||
this.logger.warn('Using hardcoded data!');
|
const note = await this.getNoteByIdOrAlias(noteIdOrAlias);
|
||||||
return {
|
return this.getMetadata(note);
|
||||||
alias: null,
|
|
||||||
createTime: new Date(),
|
|
||||||
description: 'Very descriptive text.',
|
|
||||||
editedBy: [],
|
|
||||||
id: noteIdOrAlias,
|
|
||||||
permission: {
|
|
||||||
owner: {
|
|
||||||
displayName: 'foo',
|
|
||||||
userName: 'fooUser',
|
|
||||||
email: 'foo@example.com',
|
|
||||||
photo: '',
|
|
||||||
},
|
|
||||||
sharedToUsers: [],
|
|
||||||
sharedToGroups: [],
|
|
||||||
},
|
|
||||||
tags: [],
|
|
||||||
title: 'Title!',
|
|
||||||
updateTime: new Date(),
|
|
||||||
updateUser: {
|
|
||||||
displayName: 'foo',
|
|
||||||
userName: 'fooUser',
|
|
||||||
email: 'foo@example.com',
|
|
||||||
photo: '',
|
|
||||||
},
|
|
||||||
viewCount: 42,
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
|
||||||
updateNotePermissions(
|
updateNotePermissions(
|
||||||
|
@ -212,9 +186,9 @@ export class NotesService {
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
getNoteContent(noteIdOrAlias: string) {
|
async getNoteContent(noteIdOrAlias: string): Promise<string> {
|
||||||
this.logger.warn('Using hardcoded data!');
|
const note = await this.getNoteByIdOrAlias(noteIdOrAlias);
|
||||||
return '# Markdown';
|
return this.getCurrentContent(note);
|
||||||
}
|
}
|
||||||
|
|
||||||
async toNoteDto(note: Note): Promise<NoteDto> {
|
async toNoteDto(note: Note): Promise<NoteDto> {
|
||||||
|
|
Loading…
Reference in a new issue