diff options
author | Vidhu Kant Sharma <vidhukant@vidhukant.xyz> | 2022-09-27 12:25:56 +0530 |
---|---|---|
committer | Vidhu Kant Sharma <vidhukant@vidhukant.xyz> | 2022-09-27 12:25:56 +0530 |
commit | af0ef4c190f3967d2def0c65cc3a1fce4511044e (patch) | |
tree | bba973c45ca5197ebf336d5e2f7f0f599b74bccd /src/classes | |
parent | 708862c94bd119ca7e86540fbc68595a6256c9e3 (diff) |
added shipping address functionality to /manage/clients page
Diffstat (limited to 'src/classes')
-rw-r--r-- | src/classes/client.js | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/classes/client.js b/src/classes/client.js index 524d0ce..cae528e 100644 --- a/src/classes/client.js +++ b/src/classes/client.js @@ -43,24 +43,24 @@ export class Client { this.Contact = new Contact(); this.GSTIN = ""; this.BillingAddress = new Address(); - this.ShippingAddress = []; + this.ShippingAddresses = []; } } export const saveClient = (item, ok, fail) => { axios.post("/client/new", item) - .then(res => { console.log(res);ok()}) - .catch((err) => fail()) + .then(res => ok(res)) + .catch(err => fail(err)) } export const deleteClient = (id, ok, fail) => { axios.delete(`/client/${id}`) - .then(res => ok()) - .catch((err) => fail()) + .then(res => ok(res)) + .catch(err => fail(err)) } export const getAllClients = (ok, fail) => { axios.get("/client/all") - .then(res => ok(res.data)) - .catch(err => fail()) + .then(res => ok(res.Data)) + .catch(err => fail(err)) } |