From 3753f193ff0fae8b9b053563e30acbc707412ac1 Mon Sep 17 00:00:00 2001 From: Nicolas Widart Date: Wed, 13 Sep 2017 17:30:47 +0200 Subject: [PATCH] Testing form validation --- .../Page/Assets/js/components/PageForm.vue | 29 ++++--------------- 1 file changed, 6 insertions(+), 23 deletions(-) diff --git a/Modules/Page/Assets/js/components/PageForm.vue b/Modules/Page/Assets/js/components/PageForm.vue index b88179ee0..b516c460f 100644 --- a/Modules/Page/Assets/js/components/PageForm.vue +++ b/Modules/Page/Assets/js/components/PageForm.vue @@ -6,10 +6,10 @@
- - + -
Please input Activity name
+
@@ -129,30 +129,13 @@ 'index': 'index', 'home': 'home', }, - errors: '', + form: new Form(), } }, methods: { onSubmit() { - let vm = this; - const form = new Form(this.page); - form.post(route('api.page.page.store')) - .then(response => { - }) - .catch(errors => { - console.log(errors.response.data.errors); - vm.errors = errors.response.data.errors; - }); - - -// axios.post(route('api.page.page.store'), this.page) -// .then(response => { -// console.log(response); -// }) -// .catch(response => { -// console.log(response.response.data); -// this.errors = response.response.data; -// }) + this.form = new Form(this.page); + this.form.post(route('api.page.page.store')); }, setPageTypes() { axios.get(route('api.page.page-templates.index'))