Fix invoice totals in list. Don't store full client in invoices.

This commit is contained in:
HenriT
2021-02-16 21:45:40 +02:00
parent 96fa3d1fcb
commit b291455a05
5 changed files with 28 additions and 22 deletions

View File

@ -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;