@plurix/ecom-components 1.14.2-commerce.7 → 1.14.2-commerce.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,5 @@
1
1
  import o from "axios";
2
- const n = async (t, a, e) => {
2
+ const i = async (t, a, e) => {
3
3
  try {
4
4
  if (a) {
5
5
  const { data: c } = await o.post(
@@ -7,12 +7,12 @@ const n = async (t, a, e) => {
7
7
  );
8
8
  return c;
9
9
  }
10
- const { data: r } = await o.get(`https://${e}.myvtex.com/_v/faststoreapi/checkout/pub/orderForm/${t}`);
10
+ const { data: r } = await o.get(`https://${e}.myvtex.com/api/checkout/pub/orderForm/${t}`);
11
11
  return r;
12
12
  } catch (r) {
13
13
  console.error("Error in Change Order Modal", r);
14
14
  }
15
15
  };
16
16
  export {
17
- n as getOrderForm
17
+ i as getOrderForm
18
18
  };
@@ -1,28 +1,21 @@
1
1
  import n from "axios";
2
2
  const f = async ({
3
3
  postalCode: a,
4
- isIO: p,
4
+ isIO: u,
5
5
  selectedItem: r,
6
6
  account: s
7
7
  }) => {
8
8
  try {
9
- if (p) {
9
+ if (u) {
10
10
  const { data: o } = await n.get(
11
11
  `/_v/commerce/products/productsSimilar?postalCode=${a}&skus=${r == null ? void 0 : r.productOriginId}&field=sku`
12
- ), { similarProducts: c } = o;
13
- return c.find(
14
- (t) => t.productOrigin === (r == null ? void 0 : r.productOriginId)
12
+ ), { similarProducts: p } = o;
13
+ return p.find(
14
+ (d) => d.productOrigin === (r == null ? void 0 : r.productOriginId)
15
15
  );
16
16
  }
17
- const { data: i } = await n.post("/api/proxy", {
18
- targetUrl: `https://${s}.myvtex.com/_v/commerce/products/productsSimilar?postalCode=${a}&skus=${r == null ? void 0 : r.productOriginId}&field=sku`,
19
- method: "GET",
20
- headers: {
21
- "Content-Type": "application/json",
22
- Accept: "application/json"
23
- }
24
- }), { similarProducts: u } = i;
25
- return u.find(
17
+ const { data: i } = await n.get(`https://${s}.myvtex.com/_v/commerce/products/productsSimilar?postalCode=${a}&skus=${r == null ? void 0 : r.productOriginId}&field=sku`), { similarProducts: c } = i;
18
+ return c.find(
26
19
  (o) => o.productOrigin === r.productOriginId
27
20
  );
28
21
  } catch (i) {
@@ -1,32 +1,26 @@
1
1
  import o from "axios";
2
- const i = async (t, e, a, c, n) => {
2
+ const h = async (e, t, a, c, n) => {
3
3
  try {
4
4
  const r = {
5
- orderFormId: t,
5
+ orderFormId: e,
6
6
  skuId: a,
7
7
  substitutionId: c
8
8
  };
9
- if (e) {
9
+ if (t) {
10
10
  const { data: s } = await o.post(
11
11
  "/_v/commerce/orderform/changeOrder",
12
12
  r
13
13
  );
14
14
  return s;
15
15
  }
16
- const { data: p } = await o.post("/api/proxy", {
17
- targetUrl: `https://${n}.myvtex.com/_v/commerce/orderform/changeOrder`,
18
- method: "POST",
19
- headers: {
20
- "Content-Type": "application/json",
21
- Accept: "application/json"
22
- },
16
+ const { data: d } = await o.post(`https://${n}.myvtex.com/_v/commerce/orderform/changeOrder`, {
23
17
  body: r
24
18
  });
25
- return p;
19
+ return d;
26
20
  } catch (r) {
27
21
  console.error("Error in Change Order Modal", r);
28
22
  }
29
23
  };
30
24
  export {
31
- i as postChangeOrder
25
+ h as postChangeOrder
32
26
  };
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@plurix/ecom-components",
3
3
  "author": "Plurix",
4
4
  "private": false,
5
- "version": "1.14.2-commerce.7",
5
+ "version": "1.14.2-commerce.8",
6
6
  "type": "module",
7
7
  "main": "dist/main.js",
8
8
  "types": "dist/main.d.ts",