fix bug overwriting entity changes

This commit is contained in:
zadam
2021-11-17 21:47:41 +01:00
parent 7d64f6a7dd
commit 298af217e9
3 changed files with 6 additions and 8 deletions

View File

@@ -7,12 +7,10 @@ const becca = require("../becca/becca");
let maxEntityChangeId = 0;
function addEntityChange(origEntityChange, keepOriginalId = false) {
function addEntityChange(origEntityChange) {
const ec = {...origEntityChange};
if (!keepOriginalId) {
delete ec.id;
}
delete ec.id;
ec.sourceId = ec.sourceId || cls.getSourceId() || sourceIdService.getCurrentSourceId();
ec.isSynced = ec.isSynced ? 1 : 0;