mirror of
https://github.com/mokuappio/serverless-invoices.git
synced 2025-10-30 09:21:08 -04:00
Fix invoice totals in list. Don't store full client in invoices.
This commit is contained in:
@ -43,6 +43,7 @@ class InvoiceService {
|
||||
delete invoice.$id;
|
||||
delete invoice.$isNew;
|
||||
delete invoice.$isDirty;
|
||||
delete invoice.client;
|
||||
|
||||
invoices.push(invoice);
|
||||
await storage.setItem('invoices', invoices);
|
||||
@ -62,6 +63,8 @@ class InvoiceService {
|
||||
if (Object.keys(res.errors).length > 0) {
|
||||
return Promise.reject(res);
|
||||
}
|
||||
delete invoice.client;
|
||||
|
||||
const invoices = await this.getInvoices();
|
||||
const index = invoices.findIndex(item => item.id === invoice.id);
|
||||
invoices[index] = invoice;
|
||||
|
||||
Reference in New Issue
Block a user