diff --git a/src/components/Dashboard/common/PropertyChanges.jsx b/src/components/Dashboard/common/PropertyChanges.jsx index c00405e..7f5f32d 100644 --- a/src/components/Dashboard/common/PropertyChanges.jsx +++ b/src/components/Dashboard/common/PropertyChanges.jsx @@ -18,11 +18,12 @@ const PropertyChanges = ({ type, value }) => { const val = obj[key] const newKey = prefix ? `${prefix}.${key}` : key - // Don't flatten keys that are "state" or "netGross" + // Keep model references and special value objects intact if ( val && typeof val === 'object' && !Array.isArray(val) && + !Object.prototype.hasOwnProperty.call(val, '_id') && key !== 'state' && key !== 'netGross' ) { @@ -41,6 +42,9 @@ const PropertyChanges = ({ type, value }) => { ...flatOld, ...flatNew } + + console.log(combinedChanges) + return ( {Object.keys(combinedChanges).map((key) => {