put firing of the runOnNoteContentChange on entity level instead of service level, #3436

This commit is contained in:
zadam 2023-01-14 12:57:50 +01:00
parent 2525857c20
commit 14da697a4e
2 changed files with 6 additions and 5 deletions

View File

@ -11,6 +11,7 @@ const NoteRevision = require("./note_revision");
const TaskContext = require("../../services/task_context"); const TaskContext = require("../../services/task_context");
const dayjs = require("dayjs"); const dayjs = require("dayjs");
const utc = require('dayjs/plugin/utc'); const utc = require('dayjs/plugin/utc');
const eventService = require("../../services/events");
dayjs.extend(utc) dayjs.extend(utc)
const LABEL = 'label'; const LABEL = 'label';
@ -314,6 +315,11 @@ class Note extends AbstractEntity {
utcDateChanged: pojo.utcDateModified, utcDateChanged: pojo.utcDateModified,
isSynced: true isSynced: true
}); });
eventService.emit(eventService.ENTITY_CHANGED, {
entityName: 'note_contents',
entity: this
});
} }
setJsonContent(content) { setJsonContent(content) {

View File

@ -597,11 +597,6 @@ function updateNoteContent(noteId, content) {
content = saveLinks(note, content); content = saveLinks(note, content);
note.setContent(content); note.setContent(content);
eventService.emit(eventService.ENTITY_CHANGED, {
entityName: 'note_contents',
entity: note
});
} }
/** /**