History: Add HistoryEntry

With this the backend now can hold a history entry.
Also included in this commit are some minor changes to tests and services so they can still work.

Signed-off-by: Philip Molares <philip.molares@udo.edu>
This commit is contained in:
Philip Molares 2021-02-03 21:15:39 +01:00 committed by David Mehren
parent 2ee8ff4d91
commit 300b464efd
No known key found for this signature in database
GPG key ID: 185982BA4C42B7C3
7 changed files with 72 additions and 2 deletions

View file

@ -21,6 +21,7 @@ import {
import { NoteDto } from './note.dto';
import { Note } from './note.entity';
import { Tag } from './tag.entity';
import { HistoryEntry } from '../history/history-entry.entity';
@Injectable()
export class NotesService {
@ -46,6 +47,7 @@ export class NotesService {
description: 'Very descriptive text.',
userPermissions: [],
groupPermissions: [],
historyEntries: [],
tags: [],
revisions: Promise.resolve([]),
authorColors: [],
@ -69,6 +71,7 @@ export class NotesService {
newNote.alias = alias;
}
if (owner) {
newNote.historyEntries = [HistoryEntry.create(owner)];
newNote.owner = owner;
}
return this.noteRepository.save(newNote);
@ -153,12 +156,14 @@ export class NotesService {
id: '1',
identities: [],
ownedNotes: [],
historyEntries: [],
updatedAt: new Date(),
userName: 'Testy',
},
description: 'Very descriptive text.',
userPermissions: [],
groupPermissions: [],
historyEntries: [],
tags: [],
revisions: Promise.resolve([]),
authorColors: [],