File tree 7 files changed +32
-27
lines changed
7 files changed +32
-27
lines changed Original file line number Diff line number Diff line change 4
4
5
5
- Upgrade to Laravel 8
6
6
- Update dependencies
7
+ - Catch validation errors [ #105 ] ( https://github.com/cretueusebiu/laravel-nuxt/pull/105 )
7
8
8
9
## 2.2.0 - 2020-01-12
9
10
Original file line number Diff line number Diff line change @@ -44,12 +44,11 @@ export default {
44
44
},
45
45
46
46
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
+ })
53
52
}
54
53
}
55
54
}
Original file line number Diff line number Diff line change @@ -72,12 +72,11 @@ export default {
72
72
},
73
73
74
74
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
+ })
81
80
}
82
81
}
83
82
}
Original file line number Diff line number Diff line change @@ -85,8 +85,15 @@ export default {
85
85
86
86
methods: {
87
87
async register () {
88
+ let data
89
+
88
90
// 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
+ }
90
97
91
98
// Must verify email fist.
92
99
if (data .status ) {
Original file line number Diff line number Diff line change @@ -52,12 +52,11 @@ export default {
52
52
},
53
53
54
54
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
+ })
61
60
}
62
61
}
63
62
}
Original file line number Diff line number Diff line change @@ -51,10 +51,10 @@ export default {
51
51
},
52
52
53
53
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
+ } )
58
58
}
59
59
}
60
60
}
Original file line number Diff line number Diff line change @@ -63,10 +63,10 @@ export default {
63
63
},
64
64
65
65
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
+ })
70
70
}
71
71
}
72
72
}
You can’t perform that action at this time.
0 commit comments