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>