Skip to content

Commit

Permalink
Add label for getDiffProp comparison (#1032)
Browse files Browse the repository at this point in the history
  • Loading branch information
sadiqkhoja authored Oct 31, 2023
1 parent 5b386ee commit 16c2660
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions lib/data/entity.js
Original file line number Diff line number Diff line change
Expand Up @@ -383,11 +383,9 @@ const getWithConflictDetails = (defs, audits, relevantToConflict) => {
if (v.version > 1) { // v.root is false here - can use either
const conflict = v.version !== (v.baseVersion + 1);

v.baseDiff = getDiffProp(v.dataReceived, defs[v.baseVersion - 1].data);
if ('label' in v.dataReceived && v.dataReceived.label !== defs[v.baseVersion - 1].label) v.baseDiff.push('label');
v.baseDiff = getDiffProp(v.dataReceived, { ...defs[v.baseVersion - 1].data, label: defs[v.baseVersion - 1].label });

v.serverDiff = getDiffProp(v.dataReceived, defs[v.version - 2].data);
if ('label' in v.dataReceived && v.dataReceived.label !== defs[v.version - 2].label) v.serverDiff.push('label');
v.serverDiff = getDiffProp(v.dataReceived, { ...defs[v.version - 2].data, label: defs[v.version - 2].label });

if (conflict) {
v.conflict = v.conflictingProperties && v.conflictingProperties.length > 0 ? ConflictType.HARD : ConflictType.SOFT;
Expand Down

0 comments on commit 16c2660

Please sign in to comment.