From 5cca610815ed0be27913371f8adf0de05b6a35af Mon Sep 17 00:00:00 2001 From: R-Sourabh Date: Thu, 12 Dec 2024 12:29:04 +0530 Subject: [PATCH] Fixed: field mapping iteration by accessing nested 'value' property on fieldMappingData(#533) --- src/views/BulkUpload.vue | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/src/views/BulkUpload.vue b/src/views/BulkUpload.vue index 7bef4044..9047db22 100644 --- a/src/views/BulkUpload.vue +++ b/src/views/BulkUpload.vue @@ -58,7 +58,7 @@ - + {{ translate("Upload") }} @@ -130,7 +130,6 @@ let fieldMapping = ref({}) let fileColumns = ref([]) let selectedMappingId = ref(null) const fileUploaded = ref(false); -const isUploadDisabled = ref(true); const fields = process.env["VUE_APP_MAPPING_INVCOUNT"] ? JSON.parse(process.env["VUE_APP_MAPPING_INVCOUNT"]) : {} @@ -289,14 +288,9 @@ function mapFields(mapping, mappingId) { const missingFields = Object.values(fieldMappingData.value).filter(field => { if(!csvFields.includes(field)) return field; }); - if(missingFields.length) { - isUploadDisabled.value = true - showToast(translate("Some of the mapping fields are missing in the CSV: ", { missingFields: missingFields.join(", ") })) - } else { - isUploadDisabled.value = false; - } + if(missingFields.length) showToast(translate("Some of the mapping fields are missing in the CSV: ", { missingFields: missingFields.join(", ") })) - Object.keys(fieldMappingData).map((key) => { + Object.keys(fieldMappingData.value).map((key) => { if(!csvFields.includes(fieldMappingData.value[key])){ fieldMappingData.value[key] = ""; }