From d7c2100116550296b6849e303ca1008d453ed7fd Mon Sep 17 00:00:00 2001 From: mateuswetah Date: Thu, 11 May 2023 15:50:44 -0300 Subject: [PATCH] Deep set on state changes after metadata order update inside section. --- src/views/admin/js/store/modules/metadata/mutations.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/views/admin/js/store/modules/metadata/mutations.js b/src/views/admin/js/store/modules/metadata/mutations.js index 294129cb3..939f2f59d 100644 --- a/src/views/admin/js/store/modules/metadata/mutations.js +++ b/src/views/admin/js/store/modules/metadata/mutations.js @@ -82,8 +82,12 @@ export const updateCollectionMetadataOrder = (state, { metadataOrder, metadataSe const existingSectionIndex = state.metadataSections.findIndex((aMetadataSection) => aMetadataSection.id == metadataSectionId); if (existingSectionIndex >= 0) { const updatedMetadatumIndexInsideSection = state.metadataSections[existingSectionIndex]['metadata_object_list'].findIndex((aMetadatum) => { return !!aMetadatum['id'] && (aMetadatum.id == metadataOrder[i]['id']) }); - if (updatedMetadatumIndexInsideSection >= 0) - state.metadataSections[existingSectionIndex]['metadata_object_list'][updatedMetadatumIndexInsideSection].enabled = metadataOrder[i].enabled; + if (updatedMetadatumIndexInsideSection >= 0) { + + let metadataObjectList = state.metadataSections[existingSectionIndex]['metadata_object_list']; + metadataObjectList[updatedMetadatumIndexInsideSection].enabled = metadataOrder[i].enabled; + Vue.set(state.metadataSections[existingSectionIndex], 'metadata_object_list', metadataObjectList); + } } } }