mirror of
https://github.com/Bubka/2FAuth.git
synced 2025-08-14 07:48:37 +02:00
Use and handle default Laravel validation errors response
This commit is contained in:
@ -115,8 +115,8 @@
|
||||
this.$router.push({name: 'accounts', params: { InitialEditMode: false }});
|
||||
})
|
||||
.catch(error => {
|
||||
if( error.response.data.validation ) {
|
||||
this.validationErrors = error.response.data.validation
|
||||
if( error.response.status == 422 ) {
|
||||
this.validationErrors = error.response.data.errors
|
||||
}
|
||||
else {
|
||||
this.$router.push({ name: 'genericError', params: { err: error.response.data.message } });
|
||||
@ -152,8 +152,8 @@
|
||||
this.validationErrors['qrcode'] = '';
|
||||
})
|
||||
.catch(error => {
|
||||
if( error.response.data.validation ) {
|
||||
this.validationErrors = error.response.data.validation
|
||||
if( error.response.status == 422 ) {
|
||||
this.validationErrors = error.response.data.errors
|
||||
}
|
||||
else {
|
||||
this.$router.push({ name: 'genericError', params: { err: error.response.data.message } });
|
||||
@ -185,8 +185,8 @@
|
||||
this.validationErrors['icon'] = '';
|
||||
})
|
||||
.catch(error => {
|
||||
if( error.response.data.validation ) {
|
||||
this.validationErrors = error.response.data.validation
|
||||
if( error.response.status == 422 ) {
|
||||
this.validationErrors = error.response.data.errors
|
||||
}
|
||||
else {
|
||||
this.$router.push({ name: 'genericError', params: { err: error.response.data.message } });
|
||||
|
Reference in New Issue
Block a user