mirror of
				https://github.com/zadam/trilium.git
				synced 2025-10-31 18:36:30 +01:00 
			
		
		
		
	sync fixes
This commit is contained in:
		| @@ -139,11 +139,10 @@ function getChanged(req) { | |||||||
| } | } | ||||||
|  |  | ||||||
| function update(req) { | function update(req) { | ||||||
|     const sourceId = req.body.sourceId; |     const {sourceId, entities} = req.body; | ||||||
|     const entities = req.body.entities; |  | ||||||
|  |  | ||||||
|     for (const {sync, entity} of entities) { |     for (const {entityChange, entity} of entities) { | ||||||
|         syncUpdateService.updateEntity(sync, entity, sourceId); |         syncUpdateService.updateEntity(entityChange, entity, sourceId); | ||||||
|     } |     } | ||||||
| } | } | ||||||
|  |  | ||||||
|   | |||||||
| @@ -3,13 +3,13 @@ const log = require('./log'); | |||||||
| const entityChangesService = require('./entity_changes.js'); | const entityChangesService = require('./entity_changes.js'); | ||||||
| const eventService = require('./events'); | const eventService = require('./events'); | ||||||
|  |  | ||||||
| function updateEntity(sync, entity, sourceId) { | function updateEntity(entityChange, entity, sourceId) { | ||||||
|     // can be undefined for options with isSynced=false |     // can be undefined for options with isSynced=false | ||||||
|     if (!entity) { |     if (!entity) { | ||||||
|         return false; |         return false; | ||||||
|     } |     } | ||||||
|  |  | ||||||
|     const {entityName} = sync; |     const {entityName} = entityChange; | ||||||
|     let updated; |     let updated; | ||||||
|  |  | ||||||
|     if (entityName === 'notes') { |     if (entityName === 'notes') { | ||||||
| @@ -28,7 +28,7 @@ function updateEntity(sync, entity, sourceId) { | |||||||
|         updated = updateNoteRevisionContent(entity, sourceId); |         updated = updateNoteRevisionContent(entity, sourceId); | ||||||
|     } |     } | ||||||
|     else if (entityName === 'note_reordering') { |     else if (entityName === 'note_reordering') { | ||||||
|         updated = updateNoteReordering(sync.entityId, entity, sourceId); |         updated = updateNoteReordering(entityChange.entityId, entity, sourceId); | ||||||
|     } |     } | ||||||
|     else if (entityName === 'options') { |     else if (entityName === 'options') { | ||||||
|         updated = updateOptions(entity, sourceId); |         updated = updateOptions(entity, sourceId); | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user