mirror of
https://github.com/mokuappio/serverless-invoices.git
synced 2025-11-01 02:11:08 -04:00
Improve naming conventions. Fail route first, then happy route. Abstract invoice no generation. Fix nested items validation.
This commit is contained in:
@ -131,7 +131,7 @@ export default {
|
||||
commit('clearErrors');
|
||||
|
||||
return InvoiceService.updateInvoice(getters.invoice)
|
||||
.catch(err => commit('setErrors', err.response.data.errors));
|
||||
.catch(err => commit('setErrors', err.errors));
|
||||
},
|
||||
async deleteInvoice(invoice) {
|
||||
const res = await InvoiceService.deleteInvoice(invoice.id);
|
||||
@ -161,11 +161,9 @@ export default {
|
||||
commit('clearErrors');
|
||||
|
||||
try {
|
||||
console.log('tryBookInvoice');
|
||||
const res = await InvoiceService.bookInvoice(getters.invoice);
|
||||
return dispatch('getInvoice', res.invoice_id);
|
||||
} catch (err) {
|
||||
console.log(err);
|
||||
commit('setErrors', err.errors);
|
||||
}
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user