mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-05-13 14:44:43 -04:00
fix: services use the new typings from create methods
Signed-off-by: Philip Molares <philip.molares@udo.edu>
This commit is contained in:
parent
d0b8e4cd36
commit
8cda5f99fb
4 changed files with 15 additions and 11 deletions
|
@ -97,10 +97,12 @@ export class NotesService {
|
|||
const newNote = Note.create(owner, alias);
|
||||
//TODO: Calculate patch
|
||||
newNote.revisions = Promise.resolve([
|
||||
Revision.create(noteContent, noteContent),
|
||||
Revision.create(noteContent, noteContent, newNote as Note) as Revision,
|
||||
]);
|
||||
if (owner) {
|
||||
newNote.historyEntries = [HistoryEntry.create(owner)];
|
||||
newNote.historyEntries = [
|
||||
HistoryEntry.create(owner, newNote as Note) as HistoryEntry,
|
||||
];
|
||||
}
|
||||
try {
|
||||
return await this.noteRepository.save(newNote);
|
||||
|
@ -258,7 +260,7 @@ export class NotesService {
|
|||
async updateNote(note: Note, noteContent: string): Promise<Note> {
|
||||
const revisions = await note.revisions;
|
||||
//TODO: Calculate patch
|
||||
revisions.push(Revision.create(noteContent, noteContent));
|
||||
revisions.push(Revision.create(noteContent, noteContent, note) as Revision);
|
||||
note.revisions = Promise.resolve(revisions);
|
||||
note.userPermissions = [];
|
||||
note.groupPermissions = [];
|
||||
|
@ -306,6 +308,7 @@ export class NotesService {
|
|||
);
|
||||
const createdPermission = NoteUserPermission.create(
|
||||
user,
|
||||
note,
|
||||
newUserPermission.canEdit,
|
||||
);
|
||||
createdPermission.note = note;
|
||||
|
@ -319,6 +322,7 @@ export class NotesService {
|
|||
);
|
||||
const createdPermission = NoteGroupPermission.create(
|
||||
group,
|
||||
note,
|
||||
newGroupPermission.canEdit,
|
||||
);
|
||||
createdPermission.note = note;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue