Fix success messages.

This commit is contained in:
HenriT
2021-02-17 11:11:12 +02:00
parent e23939321d
commit 5ee9b01ee6
5 changed files with 16 additions and 14 deletions

View File

@ -71,10 +71,10 @@ export default {
this.errors.clear(); this.errors.clear();
return this.$store.dispatch('bankAccounts/updateBankAccount', props) return this.$store.dispatch('bankAccounts/updateBankAccount', props)
.then((res) => { .then(() => {
NotificationService.success(res.message); NotificationService.success('Updated');
}) })
.catch(err => this.errors.set(err.response.data.errors)); .catch(err => this.errors.set(err.errors));
}, },
createBankAccount() { createBankAccount() {
this.loading = true; this.loading = true;
@ -89,7 +89,7 @@ export default {
}); });
this.$emit('done'); this.$emit('done');
}) })
.catch(err => this.errors.set(err.response.data.errors)) .catch(err => this.errors.set(err.errors))
.finally(() => { .finally(() => {
this.loading = false; this.loading = false;
}); });

View File

@ -119,10 +119,10 @@ export default {
this.errors.clear(); this.errors.clear();
this.$store.dispatch('clients/updateClient', props) this.$store.dispatch('clients/updateClient', props)
.then((res) => { .then(() => {
NotificationService.success(res.message); NotificationService.success('Updated');
}) })
.catch(err => this.errors.set(err.response.data.errors)); .catch(err => this.errors.set(err.errors));
}, },
bankAccountChanged(val) { bankAccountChanged(val) {
this.updateProp({ this.updateProp({
@ -143,7 +143,7 @@ export default {
}); });
this.$emit('done'); this.$emit('done');
}) })
.catch(err => this.errors.set(err.response.data.errors)) .catch(err => this.errors.set(err.errors))
.finally(() => { .finally(() => {
this.loading = false; this.loading = false;
}); });
@ -158,9 +158,9 @@ export default {
}); });
if (confirmed) { if (confirmed) {
this.$emit('done'); this.$emit('done');
const res = await this.$store.dispatch('clients/deleteClient', clientId); await this.$store.dispatch('clients/deleteClient', clientId);
try { try {
NotificationService.success(res.message); NotificationService.success('Deleted');
} catch (err) { } catch (err) {
NotificationService.error(err.message); NotificationService.error(err.message);
} }

View File

@ -58,8 +58,8 @@ export default {
contentClass: 'bg-base dp--24', contentClass: 'bg-base dp--24',
}); });
if (confirmed) { if (confirmed) {
const res = await this.$store.dispatch('invoices/deleteInvoice', this.invoice); await this.$store.dispatch('invoices/deleteInvoice', this.invoice);
NotificationService.success(res.message); NotificationService.success('Deleted');
this.$router.push({ this.$router.push({
name: 'invoices', name: 'invoices',
}); });

View File

@ -30,7 +30,8 @@ class BankAccountService {
} else { } else {
bankAccounts[index] = bankAccount; bankAccounts[index] = bankAccount;
} }
return storage.setItem('bank_accounts', bankAccounts); await storage.setItem('bank_accounts', bankAccounts);
return bankAccount;
} }
} }

View File

@ -124,7 +124,8 @@ class InvoiceService {
} else { } else {
invoices[index] = invoice; invoices[index] = invoice;
} }
return storage.setItem('invoices', invoices); await storage.setItem('invoices', invoices);
return invoice;
} }
} }