diff options
author | Vidhu Kant Sharma <vidhukant@vidhukant.com> | 2023-12-07 20:52:45 +0530 |
---|---|---|
committer | Vidhu Kant Sharma <vidhukant@vidhukant.com> | 2023-12-07 20:52:45 +0530 |
commit | 875e3177958f19688f066b1323d014abede70003 (patch) | |
tree | a0fac7f88734f7cd6c8a6fc3404e23610e96b65c /src | |
parent | 50de6a2309c1b137da0dad7680937be1a1a67fdc (diff) |
bug fix: billing/shipping address not getting sent properly
Diffstat (limited to 'src')
-rw-r--r-- | src/components/invoice_header_editor.vue | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/src/components/invoice_header_editor.vue b/src/components/invoice_header_editor.vue index 6bd62b8..964bd04 100644 --- a/src/components/invoice_header_editor.vue +++ b/src/components/invoice_header_editor.vue @@ -44,12 +44,27 @@ const submit = async (e: Event) => { try { const c = toRaw(customer.value) + console.log(c.BillingAddress) const res = await axios.post('/invoice', { "invoicedate": new Date(toRaw(invoiceDate.value)).toISOString(), "isdraft": true, - "billingaddress": c.BillingAddress, - "shippingaddress": c.BillingAddress, // TODO + "BillingAddress": { + // NOTE: just c.BillingAddress doesn't work for some reason + "AddressText": c.BillingAddress.AddressText, + "City": c.BillingAddress.City, + "State": c.BillingAddress.State, + "PostalCode": c.BillingAddress.PostalCode, + "Country": c.BillingAddress.Country, + }, + "ShippingAddress": { + // TODO: don't use the billing address! + "AddressText": c.BillingAddress.AddressText, + "City": c.BillingAddress.City, + "State": c.BillingAddress.State, + "PostalCode": c.BillingAddress.PostalCode, + "Country": c.BillingAddress.Country, + }, "customername": c.Name, "customergstin": c.Gstin, "customercontactname": c.ContactName, |