refactored "sync" table to "entity_changes"

This commit is contained in:
zadam
2020-08-02 23:27:48 +02:00
parent 5a5ea4f474
commit 864271d5ef
32 changed files with 170 additions and 187 deletions

View File

@@ -2,7 +2,7 @@
const sql = require('../../services/sql');
const utils = require('../../services/utils');
const syncTableService = require('../../services/sync_table');
const entityChangesService = require('../../services/entity_changes.js');
const treeService = require('../../services/tree');
const noteService = require('../../services/notes');
const repository = require('../../services/repository');
@@ -66,7 +66,7 @@ function moveBranchBeforeNote(req) {
sql.execute("UPDATE branches SET notePosition = notePosition + 10 WHERE parentNoteId = ? AND notePosition >= ? AND isDeleted = 0",
[beforeNote.parentNoteId, beforeNote.notePosition]);
syncTableService.addNoteReorderingSync(beforeNote.parentNoteId);
entityChangesService.addNoteReorderingSync(beforeNote.parentNoteId);
if (branchToMove.parentNoteId === beforeNote.parentNoteId) {
branchToMove.notePosition = beforeNote.notePosition;
@@ -100,7 +100,7 @@ function moveBranchAfterNote(req) {
sql.execute("UPDATE branches SET notePosition = notePosition + 10 WHERE parentNoteId = ? AND notePosition > ? AND isDeleted = 0",
[afterNote.parentNoteId, afterNote.notePosition]);
syncTableService.addNoteReorderingSync(afterNote.parentNoteId);
entityChangesService.addNoteReorderingSync(afterNote.parentNoteId);
const movedNotePosition = afterNote.notePosition + 10;