From f8d9865c097c4282b199e67b31c2e48e93fc2267 Mon Sep 17 00:00:00 2001 From: Jonathan Reinink Date: Tue, 22 Dec 2020 13:22:30 -0500 Subject: [PATCH] Update create contact form to use the new Inertia form --- resources/js/Pages/Contacts/Create.vue | 38 ++++++++++---------------- 1 file changed, 14 insertions(+), 24 deletions(-) diff --git a/resources/js/Pages/Contacts/Create.vue b/resources/js/Pages/Contacts/Create.vue index 130d263..299a80c 100644 --- a/resources/js/Pages/Contacts/Create.vue +++ b/resources/js/Pages/Contacts/Create.vue @@ -5,28 +5,28 @@ / Create
-
+
- - - + + + - - - - - - + + + + + + - +
- Create Contact + Create Contact
@@ -48,14 +48,12 @@ export default { TextInput, }, props: { - errors: Object, organizations: Array, }, remember: 'form', data() { return { - sending: false, - form: { + form: this.$inertia.form({ first_name: null, last_name: null, organization_id: null, @@ -66,16 +64,8 @@ export default { region: null, country: null, postal_code: null, - }, + }), } }, - methods: { - submit() { - this.$inertia.post(this.route('contacts.store'), this.form, { - onStart: () => this.sending = true, - onFinish: () => this.sending = false, - }) - }, - }, }