Merge pull request #425 from shariquerik/contact-email-fix

This commit is contained in:
Shariq Ansari 2024-10-22 13:10:47 +05:30 committed by GitHub
commit e9b448a16d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -279,7 +279,7 @@ const filteredSections = computed(() => {
_contact.value.email_id = option.value _contact.value.email_id = option.value
} }
} else { } else {
editOption('Contact Email', option.name, option.value) editOption('Contact Email', option.name, 'email_id', option.value)
} }
}, },
onDelete: async (option, isNew) => { onDelete: async (option, isNew) => {
@ -332,7 +332,7 @@ const filteredSections = computed(() => {
_contact.value.actual_mobile_no = option.value _contact.value.actual_mobile_no = option.value
} }
} else { } else {
editOption('Contact Phone', option.name, option.value) editOption('Contact Phone', option.name, 'phone', option.value)
} }
}, },
onDelete: async (option, isNew) => { onDelete: async (option, isNew) => {
@ -415,11 +415,11 @@ async function createNew(field, value) {
} }
} }
async function editOption(doctype, name, value) { async function editOption(doctype, name, fieldname, value) {
let d = await call('frappe.client.set_value', { let d = await call('frappe.client.set_value', {
doctype, doctype,
name, name,
fieldname: doctype == 'Contact Phone' ? 'phone' : 'email', fieldname,
value, value,
}) })
if (d) { if (d) {