Merge branch 'fix-issue' into 'master'

fix small issues

See merge request mohit.panjvani/crater-web!12
This commit is contained in:
Mohit Panjwani
2019-11-13 08:35:26 +00:00
6 changed files with 35 additions and 15 deletions

View File

@ -624,17 +624,20 @@ export default {
this.isLoading = true
this.formData.currency_id = this.currency.id
}
let response = await this.addCustomer(this.formData)
if (response.data.success) {
window.toastr['success'](this.$t('customers.created_message'))
this.$router.push('/admin/customers')
this.isLoading = false
return true
try {
let response = await this.addCustomer(this.formData)
if (response.data.success) {
window.toastr['success'](this.$t('customers.created_message'))
this.$router.push('/admin/customers')
this.isLoading = false
return true
}
} catch (err) {
if (err.response.data.errors.email) {
this.isLoading = false
window.toastr['error'](this.$t('validation.email_already_taken'))
}
}
window.toastr['error'](response.data.error)
}
},
async fetchBillingState () {