Skip to content

Commit 5eec4f3

Browse files
committed
1 parent 7ee0c9c commit 5eec4f3

File tree

7 files changed

+32
-27
lines changed

7 files changed

+32
-27
lines changed

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
- Upgrade to Laravel 8
66
- Update dependencies
7+
- Catch validation errors [#105](https://github.com/cretueusebiu/laravel-nuxt/pull/105)
78

89
## 2.2.0 - 2020-01-12
910

client/pages/auth/password/email.vue

+5-6
Original file line numberDiff line numberDiff line change
@@ -44,12 +44,11 @@ export default {
4444
},
4545
4646
methods: {
47-
async send () {
48-
const { data } = await this.form.post('/password/email')
49-
50-
this.status = data.status
51-
52-
this.form.reset()
47+
send () {
48+
this.form.post('/password/email').then(({ data }) => {
49+
this.status = data.status
50+
this.form.reset()
51+
})
5352
}
5453
}
5554
}

client/pages/auth/password/reset.vue

+5-6
Original file line numberDiff line numberDiff line change
@@ -72,12 +72,11 @@ export default {
7272
},
7373
7474
methods: {
75-
async reset () {
76-
const { data } = await this.form.post('/password/reset')
77-
78-
this.status = data.status
79-
80-
this.form.reset()
75+
reset () {
76+
this.form.post('/password/reset').then(({ data }) => {
77+
this.status = data.status
78+
this.form.reset()
79+
})
8180
}
8281
}
8382
}

client/pages/auth/register.vue

+8-1
Original file line numberDiff line numberDiff line change
@@ -85,8 +85,15 @@ export default {
8585
8686
methods: {
8787
async register () {
88+
let data
89+
8890
// Register the user.
89-
const { data } = await this.form.post('/register')
91+
try {
92+
const response = await this.form.post('/register')
93+
data = response.data
94+
} catch (e) {
95+
return
96+
}
9097
9198
// Must verify email fist.
9299
if (data.status) {

client/pages/auth/verification/resend.vue

+5-6
Original file line numberDiff line numberDiff line change
@@ -52,12 +52,11 @@ export default {
5252
},
5353
5454
methods: {
55-
async send () {
56-
const { data } = await this.form.post('/email/resend')
57-
58-
this.status = data.status
59-
60-
this.form.reset()
55+
send () {
56+
this.form.post('/email/resend').then(({ data }) => {
57+
this.status = data.status
58+
this.form.reset()
59+
})
6160
}
6261
}
6362
}

client/pages/settings/password.vue

+4-4
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,10 @@ export default {
5151
},
5252
5353
methods: {
54-
async update () {
55-
await this.form.patch('/settings/password')
56-
57-
this.form.reset()
54+
update () {
55+
this.form.patch('/settings/password').then(() => {
56+
this.form.reset()
57+
})
5858
}
5959
}
6060
}

client/pages/settings/profile.vue

+4-4
Original file line numberDiff line numberDiff line change
@@ -63,10 +63,10 @@ export default {
6363
},
6464
6565
methods: {
66-
async update () {
67-
const { data } = await this.form.patch('/settings/profile')
68-
69-
this.$store.dispatch('auth/updateUser', { user: data })
66+
update () {
67+
this.form.patch('/settings/profile').then(({ data: user }) => {
68+
this.$store.dispatch('auth/updateUser', { user })
69+
})
7070
}
7171
}
7272
}

0 commit comments

Comments
 (0)