mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-05-18 17:25:16 -04:00
History: Add history service and usage
Add history service to allow for CRUD operations. Use history service in controllers to: 1. Allow manipulating of history entries 2. Guaranty the correct existence of history entries Signed-off-by: Philip Molares <philip.molares@udo.edu>
This commit is contained in:
parent
b76fa91a3c
commit
7f1afc30c9
8 changed files with 173 additions and 118 deletions
|
@ -177,6 +177,10 @@ export class NotesService {
|
|||
return this.getCurrentContent(note);
|
||||
}
|
||||
|
||||
toTagList(note: Note): string[] {
|
||||
return note.tags.map((tag) => tag.name);
|
||||
}
|
||||
|
||||
async toNotePermissionsDto(note: Note): Promise<NotePermissionsDto> {
|
||||
return {
|
||||
owner: this.usersService.toUserDto(note.owner),
|
||||
|
@ -204,7 +208,7 @@ export class NotesService {
|
|||
),
|
||||
// TODO: Extract into method
|
||||
permissions: await this.toNotePermissionsDto(note),
|
||||
tags: note.tags.map((tag) => tag.name),
|
||||
tags: this.toTagList(note),
|
||||
updateTime: (await this.getLatestRevision(note)).createdAt,
|
||||
// TODO: Get actual updateUser
|
||||
updateUser: {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue