mirror of
				https://github.com/crater-invoice/crater.git
				synced 2025-10-29 12:41:10 -04:00 
			
		
		
		
	fix customer modal email validation
This commit is contained in:
		| @ -629,6 +629,7 @@ export default { | |||||||
|       } else { |       } else { | ||||||
|         this.formData.currency_id = this.defaultCurrency.id |         this.formData.currency_id = this.defaultCurrency.id | ||||||
|       } |       } | ||||||
|  |       try { | ||||||
|         let response = await this.addCustomer(this.formData) |         let response = await this.addCustomer(this.formData) | ||||||
|         if (response.data) { |         if (response.data) { | ||||||
|           window.toastr['success'](this.$tc('customers.created_message')) |           window.toastr['success'](this.$tc('customers.created_message')) | ||||||
| @ -643,7 +644,13 @@ export default { | |||||||
|           this.closeModal() |           this.closeModal() | ||||||
|           return true |           return true | ||||||
|         } |         } | ||||||
|       window.toastr['error'](response.data.error) |       // window.toastr['error'](response.data.error) | ||||||
|  |       } catch (err) { | ||||||
|  |         if (err.response.data.errors.email) { | ||||||
|  |           this.isLoading = false | ||||||
|  |           window.toastr['error'](this.$t('validation.email_already_taken')) | ||||||
|  |         } | ||||||
|  |       } | ||||||
|     }, |     }, | ||||||
|     async fetchCountry () { |     async fetchCountry () { | ||||||
|       let res = await window.axios.get('/api/countries') |       let res = await window.axios.get('/api/countries') | ||||||
|  | |||||||
		Reference in New Issue
	
	Block a user