diff --git a/packages/openchs-android/src/action/common/AddressLevelsState.js b/packages/openchs-android/src/action/common/AddressLevelsState.js index a9df67dd3..585b1e868 100644 --- a/packages/openchs-android/src/action/common/AddressLevelsState.js +++ b/packages/openchs-android/src/action/common/AddressLevelsState.js @@ -3,9 +3,17 @@ import _ from 'lodash'; class AddressLevelsState { constructor(levels = []) { const unsortedLevels = Object.entries(_.uniqBy(levels, l => l.uuid) - .reduce((acc, addrLevel) => { - addrLevel.isSelected = addrLevel.isSelected || false; - acc[addrLevel.type] = _.defaultTo(acc[addrLevel.type], []).concat([addrLevel]); + .reduce((acc, {locationMappings, uuid, name, level, type, parentUuid, typeUuid, isSelected = false}) => { + acc[type] = _.defaultTo(acc[type], []).concat([{ + uuid, + name, + level, + type, + parentUuid, + typeUuid, + isSelected, + locationMappings + }]); return acc; }, {})); this.levels = unsortedLevels.map(([levelType, levels]) => {