diff --git a/frontend/src/pages/Contact.vue b/frontend/src/pages/Contact.vue index 5e3808fa..c4f71105 100644 --- a/frontend/src/pages/Contact.vue +++ b/frontend/src/pages/Contact.vue @@ -79,7 +79,12 @@ - + + + + + + { - contacts.reload() - }, +async function changeContactImage(file) { + await call('frappe.client.set_value', { + doctype: 'Contact', + name: props.contact.name, + fieldname: 'image', + value: file?.file_url || '', + }) + contacts.reload() +} + +async function deleteContact() { + $dialog({ + title: 'Delete contact', + message: 'Are you sure you want to delete this contact?', + actions: [ + { + label: 'Delete', + theme: 'red', + variant: 'solid', + async onClick({ close }) { + await call('frappe.client.delete', { + doctype: 'Contact', + name: props.contact.name, + }) + contacts.reload() + close() + }, + }, + ], }) }