From 312a5eb4edc40dabf11a3be0b5316f89168d2335 Mon Sep 17 00:00:00 2001 From: Jonathan Reinink Date: Tue, 22 Dec 2020 13:26:13 -0500 Subject: [PATCH] Update edit contact form to use the new Inertia form --- resources/js/Pages/Contacts/Edit.vue | 35 +++++++++++----------------- 1 file changed, 14 insertions(+), 21 deletions(-) diff --git a/resources/js/Pages/Contacts/Edit.vue b/resources/js/Pages/Contacts/Edit.vue index 0c803fd..7c09514 100644 --- a/resources/js/Pages/Contacts/Edit.vue +++ b/resources/js/Pages/Contacts/Edit.vue @@ -9,29 +9,29 @@ This contact has been deleted.
-
+
- - - + + + - - - - - - + + + + + + - +
- Update Contact + Update Contact
@@ -66,8 +66,7 @@ export default { remember: 'form', data() { return { - sending: false, - form: { + form: this.$inertia.form({ first_name: this.contact.first_name, last_name: this.contact.last_name, organization_id: this.contact.organization_id, @@ -78,16 +77,10 @@ export default { region: this.contact.region, country: this.contact.country, postal_code: this.contact.postal_code, - }, + }), } }, methods: { - submit() { - this.$inertia.put(this.route('contacts.update', this.contact.id), this.form, { - onStart: () => this.sending = true, - onFinish: () => this.sending = false, - }) - }, destroy() { if (confirm('Are you sure you want to delete this contact?')) { this.$inertia.delete(this.route('contacts.destroy', this.contact.id))