From af0ef4c190f3967d2def0c65cc3a1fce4511044e Mon Sep 17 00:00:00 2001 From: Vidhu Kant Sharma Date: Tue, 27 Sep 2022 12:25:56 +0530 Subject: added shipping address functionality to /manage/clients page --- src/classes/client.js | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'src/classes/client.js') 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)) } -- cgit v1.2.3