fix: delete batch and pass fields prop to brand settings
This commit is contained in:
@@ -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>
|
||||
|
||||
@@ -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'"
|
||||
|
||||
Reference in New Issue
Block a user