fix: delete batch and pass fields prop to brand settings

This commit is contained in:
Jannat Patel
2025-07-10 22:21:26 +05:30
parent b8ae0db0bd
commit 6f9f27c030
6 changed files with 152 additions and 27 deletions

View File

@@ -88,9 +88,31 @@ const update = () => {
)
}
watch(branding, (newData) => {
if (newData && !isDirty.value) {
isDirty.value = true
}
watch(branding, (updatedDoc) => {
let textFields = []
let imageFields = []
props.fields.forEach((f) => {
if (f.type === 'Upload') {
imageFields.push(f.name)
} else {
textFields.push(f.name)
}
})
textFields.forEach((field) => {
if (updatedDoc.data[field] != updatedDoc.previousData[field]) {
isDirty.value = true
}
})
imageFields.forEach((field) => {
if (
updatedDoc.data[field] &&
updatedDoc.data[field].file_url != updatedDoc.previousData[field].file_url
) {
isDirty.value = true
}
})
})
</script>

View File

@@ -37,8 +37,13 @@
<component
v-if="activeTab.template"
:is="activeTab.template"
:label="activeTab.label"
:description="activeTab.description"
v-bind="{
label: activeTab.label,
description: activeTab.description,
...(activeTab.label === 'Branding'
? { fields: activeTab.fields }
: {}),
}"
/>
<PaymentSettings
v-else-if="activeTab.label === 'Payment Gateway'"