Merge branch 'master' of gitlab.com:mohit.panjvani/crater-web

This commit is contained in:
Mohit Panjwani
2019-11-23 12:18:48 +05:30
4 changed files with 11 additions and 3 deletions

View File

@ -586,11 +586,16 @@ export default {
this.isLoading = true
try {
let response = await this.updateCustomer(this.formData)
if (response.data) {
if (response.data.success) {
window.toastr['success'](this.$t('customers.updated_message'))
this.$router.push('/admin/customers')
this.isLoading = false
return true
} else {
this.isLoading = false
if (response.data.error) {
window.toastr['error'](this.$t('validation.email_already_taken'))
}
}
} catch (err) {
if (err.response.data.errors.email) {

View File

@ -83,7 +83,7 @@
:allow-empty="false"
:disabled="isEdit"
:placeholder="$t('invoices.select_invoice')"
label="invoice_number"
:custom-label="invoiceWithAmount"
track-by="invoice_number"
/>
</div>
@ -283,6 +283,9 @@ export default {
'updatePayment',
'fetchPayment'
]),
invoiceWithAmount ({ invoice_number, due_amount }) {
return `${invoice_number} (${this.$utils.formatGraphMoney(due_amount, this.customer.currency)})`
},
async loadData () {
if (this.isEdit) {
let response = await this.fetchPayment(this.$route.params.id)