mirror of
https://github.com/mokuappio/serverless-invoices.git
synced 2025-10-27 16:01:07 -04:00
Fix success messages.
This commit is contained in:
@ -71,10 +71,10 @@ export default {
|
||||
this.errors.clear();
|
||||
|
||||
return this.$store.dispatch('bankAccounts/updateBankAccount', props)
|
||||
.then((res) => {
|
||||
NotificationService.success(res.message);
|
||||
.then(() => {
|
||||
NotificationService.success('Updated');
|
||||
})
|
||||
.catch(err => this.errors.set(err.response.data.errors));
|
||||
.catch(err => this.errors.set(err.errors));
|
||||
},
|
||||
createBankAccount() {
|
||||
this.loading = true;
|
||||
@ -89,7 +89,7 @@ export default {
|
||||
});
|
||||
this.$emit('done');
|
||||
})
|
||||
.catch(err => this.errors.set(err.response.data.errors))
|
||||
.catch(err => this.errors.set(err.errors))
|
||||
.finally(() => {
|
||||
this.loading = false;
|
||||
});
|
||||
|
||||
@ -119,10 +119,10 @@ export default {
|
||||
this.errors.clear();
|
||||
|
||||
this.$store.dispatch('clients/updateClient', props)
|
||||
.then((res) => {
|
||||
NotificationService.success(res.message);
|
||||
.then(() => {
|
||||
NotificationService.success('Updated');
|
||||
})
|
||||
.catch(err => this.errors.set(err.response.data.errors));
|
||||
.catch(err => this.errors.set(err.errors));
|
||||
},
|
||||
bankAccountChanged(val) {
|
||||
this.updateProp({
|
||||
@ -143,7 +143,7 @@ export default {
|
||||
});
|
||||
this.$emit('done');
|
||||
})
|
||||
.catch(err => this.errors.set(err.response.data.errors))
|
||||
.catch(err => this.errors.set(err.errors))
|
||||
.finally(() => {
|
||||
this.loading = false;
|
||||
});
|
||||
@ -158,9 +158,9 @@ export default {
|
||||
});
|
||||
if (confirmed) {
|
||||
this.$emit('done');
|
||||
const res = await this.$store.dispatch('clients/deleteClient', clientId);
|
||||
await this.$store.dispatch('clients/deleteClient', clientId);
|
||||
try {
|
||||
NotificationService.success(res.message);
|
||||
NotificationService.success('Deleted');
|
||||
} catch (err) {
|
||||
NotificationService.error(err.message);
|
||||
}
|
||||
|
||||
@ -58,8 +58,8 @@ export default {
|
||||
contentClass: 'bg-base dp--24',
|
||||
});
|
||||
if (confirmed) {
|
||||
const res = await this.$store.dispatch('invoices/deleteInvoice', this.invoice);
|
||||
NotificationService.success(res.message);
|
||||
await this.$store.dispatch('invoices/deleteInvoice', this.invoice);
|
||||
NotificationService.success('Deleted');
|
||||
this.$router.push({
|
||||
name: 'invoices',
|
||||
});
|
||||
|
||||
@ -30,7 +30,8 @@ class BankAccountService {
|
||||
} else {
|
||||
bankAccounts[index] = bankAccount;
|
||||
}
|
||||
return storage.setItem('bank_accounts', bankAccounts);
|
||||
await storage.setItem('bank_accounts', bankAccounts);
|
||||
return bankAccount;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -124,7 +124,8 @@ class InvoiceService {
|
||||
} else {
|
||||
invoices[index] = invoice;
|
||||
}
|
||||
return storage.setItem('invoices', invoices);
|
||||
await storage.setItem('invoices', invoices);
|
||||
return invoice;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user