@plurix/ecom-components 1.14.1-COM-1442.2 → 1.14.1-bugfix-1891.0
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.
- package/dist/node_modules/@faststore/components/dist/esm/atoms/Button/Button.js +45 -0
- package/dist/node_modules/@faststore/components/dist/esm/atoms/Loader/Loader.js +34 -0
- package/dist/node_modules/@faststore/components/dist/esm/molecules/IconButton/IconButton.js +29 -0
- package/dist/packages/Carousel/Carousel.js +1 -1
- package/dist/packages/CartClubAlert/CartClubAlert.js +1 -1
- package/dist/packages/ChangeOrderModal/ChangeOrderModal.d.ts +1 -12
- package/dist/packages/ChangeOrderModal/ChangeOrderModal.js +67 -78
- package/dist/packages/ChangeOrderModal/api/getOrderForm.js +15 -6
- package/dist/packages/ChangeOrderModal/api/getProductsSimilars.d.ts +4 -7
- package/dist/packages/ChangeOrderModal/api/getProductsSimilars.js +21 -22
- package/dist/packages/ChangeOrderModal/api/postChangeOrder.d.ts +1 -6
- package/dist/packages/ChangeOrderModal/api/postChangeOrder.js +17 -11
- package/dist/packages/Coupons/Coupons.d.ts +1 -4
- package/dist/packages/Coupons/Coupons.js +57 -67
- package/dist/packages/Coupons/components/CouponCard.d.ts +1 -3
- package/dist/packages/Coupons/components/CouponCard.js +83 -94
- package/dist/packages/Coupons/views/CouponsView.d.ts +1 -3
- package/dist/packages/Coupons/views/CouponsView.js +78 -87
- package/dist/packages/Coupons/views/LoadingView.js +6 -6
- package/dist/packages/Modal/Modal.js +1 -1
- package/dist/packages/Onboarding/Onboarding.js +1 -1
- package/dist/packages/ProductCard/ProductCardBadge/ProductCardBadgeKg.js +10 -13
- package/dist/packages/ProductCard/ProductCardBadge/ProductCardDiscountBadge.d.ts +2 -3
- package/dist/packages/ProductCard/ProductCardBadge/ProductCardDiscountBadge.js +31 -15
- package/dist/packages/ProductCard/ProductCardButton/AddToCartButton.js +1 -1
- package/dist/packages/ProductCard/ProductCardButton/CustomQuantitySelector/index.d.ts +2 -17
- package/dist/packages/ProductCard/ProductCardButton/CustomQuantitySelector/index.js +1 -1
- package/dist/packages/ProductCard/ProductCardButton/QuantitySelector.js +6 -6
- package/dist/packages/ProductCard/ProductCardHorizontal/index.js +30 -31
- package/dist/packages/ProductCard/ProductCardPrice/index.d.ts +1 -8
- package/dist/packages/ProductCard/ProductCardPrice/index.js +31 -27
- package/dist/packages/ProductCard/ProductCardVertical/index.js +15 -16
- package/dist/packages/ProductCard/index.js +1 -1
- package/dist/packages/ProductCardSeeMore/ProductCardSeeMore.js +1 -1
- package/dist/packages/Regionalization/Regionalization.d.ts +1 -1
- package/dist/packages/Regionalization/Regionalization.js +13 -15
- package/dist/packages/Regionalization/context/RegionalizationContext.d.ts +1 -1
- package/dist/packages/Regionalization/context/RegionalizationContext.js +29 -31
- package/dist/packages/Regionalization/types/RegionalizationProps.d.ts +0 -1
- package/dist/packages/Regionalization/views/AllStoresScreen.js +21 -21
- package/dist/packages/Regionalization/views/InitialView.js +26 -24
- package/dist/packages/Tour/Tour.js +1 -1
- package/dist/styles/product-card.global.css +1 -1
- package/dist/styles/regionalization.global.css +1 -1
- package/dist/types/ProductCard.d.ts +12 -13
- package/dist/utils/changerOrderModal.js +16 -13
- package/package.json +71 -69
- package/dist/packages/ProductCard/ProductCardButton/CustomQuantitySelector/Button.d.ts +0 -18
- package/dist/packages/ProductCard/ProductCardButton/CustomQuantitySelector/Button.js +0 -80
- package/dist/packages/ProductCard/ProductCardButton/CustomQuantitySelector/IconButton.d.ts +0 -10
- package/dist/packages/ProductCard/ProductCardButton/CustomQuantitySelector/IconButton.js +0 -61
- package/dist/packages/ProductCard/ProductCardButton/CustomQuantitySelector/Loader.d.ts +0 -8
- package/dist/packages/ProductCard/ProductCardButton/CustomQuantitySelector/Loader.js +0 -44
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
var R = Object.defineProperty;
|
|
2
|
+
var o = Object.getOwnPropertySymbols;
|
|
3
|
+
var b = Object.prototype.hasOwnProperty, m = Object.prototype.propertyIsEnumerable;
|
|
4
|
+
var l = (e, a, t) => a in e ? R(e, a, { enumerable: !0, configurable: !0, writable: !0, value: t }) : e[a] = t, p = (e, a) => {
|
|
5
|
+
for (var t in a || (a = {}))
|
|
6
|
+
b.call(a, t) && l(e, t, a[t]);
|
|
7
|
+
if (o)
|
|
8
|
+
for (var t of o(a))
|
|
9
|
+
m.call(a, t) && l(e, t, a[t]);
|
|
10
|
+
return e;
|
|
11
|
+
};
|
|
12
|
+
var c = (e, a) => {
|
|
13
|
+
var t = {};
|
|
14
|
+
for (var r in e)
|
|
15
|
+
b.call(e, r) && a.indexOf(r) < 0 && (t[r] = e[r]);
|
|
16
|
+
if (e != null && o)
|
|
17
|
+
for (var r of o(e))
|
|
18
|
+
a.indexOf(r) < 0 && m.call(e, r) && (t[r] = e[r]);
|
|
19
|
+
return t;
|
|
20
|
+
};
|
|
21
|
+
import n, { forwardRef as h } from "react";
|
|
22
|
+
import k from "../Loader/Loader.js";
|
|
23
|
+
const x = h(function(y, w) {
|
|
24
|
+
var s = y, { children: a, variant: t, inverse: r, size: i = "regular", testId: E = "fs-button", loading: f, loadingLabel: g, icon: u, iconPosition: d = "left", disabled: B } = s, v = c(s, ["children", "variant", "inverse", "size", "testId", "loading", "loadingLabel", "icon", "iconPosition", "disabled"]);
|
|
25
|
+
return n.createElement(
|
|
26
|
+
"button",
|
|
27
|
+
p({ ref: w, "data-fs-button": !0, "data-fs-button-inverse": r, "data-fs-button-size": i, "data-fs-button-loading": f, "data-fs-button-variant": t, disabled: B, "data-testid": E }, v),
|
|
28
|
+
n.createElement(
|
|
29
|
+
"div",
|
|
30
|
+
{ "data-fs-button-wrapper": !0 },
|
|
31
|
+
f && n.createElement(
|
|
32
|
+
"p",
|
|
33
|
+
{ "data-fs-button-loading-label": !0 },
|
|
34
|
+
g,
|
|
35
|
+
n.createElement(k, { variant: t === "primary" && !r ? "light" : "dark" })
|
|
36
|
+
),
|
|
37
|
+
!!u && d === "left" && n.createElement("span", { "data-fs-button-icon": !0 }, u),
|
|
38
|
+
a && n.createElement("span", null, a),
|
|
39
|
+
!!u && d === "right" && n.createElement("span", { "data-fs-button-icon": !0 }, u)
|
|
40
|
+
)
|
|
41
|
+
);
|
|
42
|
+
}), j = x;
|
|
43
|
+
export {
|
|
44
|
+
j as default
|
|
45
|
+
};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
var u = Object.defineProperty;
|
|
2
|
+
var d = Object.getOwnPropertySymbols;
|
|
3
|
+
var f = Object.prototype.hasOwnProperty, l = Object.prototype.propertyIsEnumerable;
|
|
4
|
+
var s = (e, t, a) => t in e ? u(e, t, { enumerable: !0, configurable: !0, writable: !0, value: a }) : e[t] = a, m = (e, t) => {
|
|
5
|
+
for (var a in t || (t = {}))
|
|
6
|
+
f.call(t, a) && s(e, a, t[a]);
|
|
7
|
+
if (d)
|
|
8
|
+
for (var a of d(t))
|
|
9
|
+
l.call(t, a) && s(e, a, t[a]);
|
|
10
|
+
return e;
|
|
11
|
+
};
|
|
12
|
+
var c = (e, t) => {
|
|
13
|
+
var a = {};
|
|
14
|
+
for (var r in e)
|
|
15
|
+
f.call(e, r) && t.indexOf(r) < 0 && (a[r] = e[r]);
|
|
16
|
+
if (e != null && d)
|
|
17
|
+
for (var r of d(e))
|
|
18
|
+
t.indexOf(r) < 0 && l.call(e, r) && (a[r] = e[r]);
|
|
19
|
+
return a;
|
|
20
|
+
};
|
|
21
|
+
import o, { forwardRef as p } from "react";
|
|
22
|
+
const E = p(function(L, i) {
|
|
23
|
+
var n = L, { testId: t = "fs-loader", variant: a = "dark" } = n, r = c(n, ["testId", "variant"]);
|
|
24
|
+
return o.createElement(
|
|
25
|
+
"span",
|
|
26
|
+
m({ ref: i, "data-fs-loader": !0, "data-fs-loader-variant": a, "data-testid": t }, r),
|
|
27
|
+
o.createElement("span", { "data-fs-loader-item": !0 }),
|
|
28
|
+
o.createElement("span", { "data-fs-loader-item": !0 }),
|
|
29
|
+
o.createElement("span", { "data-fs-loader-item": !0 })
|
|
30
|
+
);
|
|
31
|
+
}), v = E;
|
|
32
|
+
export {
|
|
33
|
+
v as default
|
|
34
|
+
};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
var I = Object.defineProperty;
|
|
2
|
+
var r = Object.getOwnPropertySymbols;
|
|
3
|
+
var f = Object.prototype.hasOwnProperty, s = Object.prototype.propertyIsEnumerable;
|
|
4
|
+
var c = (t, e, o) => e in t ? I(t, e, { enumerable: !0, configurable: !0, writable: !0, value: o }) : t[e] = o, i = (t, e) => {
|
|
5
|
+
for (var o in e || (e = {}))
|
|
6
|
+
f.call(e, o) && c(t, o, e[o]);
|
|
7
|
+
if (r)
|
|
8
|
+
for (var o of r(e))
|
|
9
|
+
s.call(e, o) && c(t, o, e[o]);
|
|
10
|
+
return t;
|
|
11
|
+
};
|
|
12
|
+
var l = (t, e) => {
|
|
13
|
+
var o = {};
|
|
14
|
+
for (var n in t)
|
|
15
|
+
f.call(t, n) && e.indexOf(n) < 0 && (o[n] = t[n]);
|
|
16
|
+
if (t != null && r)
|
|
17
|
+
for (var n of r(t))
|
|
18
|
+
e.indexOf(n) < 0 && s.call(t, n) && (o[n] = t[n]);
|
|
19
|
+
return o;
|
|
20
|
+
};
|
|
21
|
+
import p, { forwardRef as R } from "react";
|
|
22
|
+
import g from "../../atoms/Button/Button.js";
|
|
23
|
+
const w = R(function(x, B) {
|
|
24
|
+
var a = x, { icon: e, children: o, testId: n = "fs-icon-button", "aria-label": b, size: d = "regular", variant: u } = a, m = l(a, ["icon", "children", "testId", "aria-label", "size", "variant"]);
|
|
25
|
+
return p.createElement(g, i({ ref: B, "data-fs-button": !0, "data-fs-icon-button": !0, variant: u != null ? u : "tertiary", icon: e, "aria-label": b, testId: n, size: d }, m), o);
|
|
26
|
+
}), $ = w;
|
|
27
|
+
export {
|
|
28
|
+
$ as default
|
|
29
|
+
};
|
|
@@ -15,7 +15,7 @@ import { Children as X, useState as m, useRef as D, useEffect as Y } from "react
|
|
|
15
15
|
import Z from "./components/Bullets.js";
|
|
16
16
|
import E from "./components/Arrows.js";
|
|
17
17
|
import { DefaultProps as M } from "./utils/defaultProps.js";
|
|
18
|
-
/* empty css
|
|
18
|
+
/* empty css */const rt = ({
|
|
19
19
|
children: s,
|
|
20
20
|
id: r,
|
|
21
21
|
bullet: t,
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import { Dispatch, SetStateAction } from 'react';
|
|
2
2
|
import { SelectedItemProps } from './components/ProductSelected';
|
|
3
3
|
import { SimilarProducts as SimilarProductsProps } from '../../types/ChangeOrderModal';
|
|
4
|
-
import { GetProductsSimilarsResponse } from './api/getProductsSimilars';
|
|
5
|
-
import { PostChangeOrderMutationResponse } from './api/postChangeOrder';
|
|
6
4
|
|
|
7
5
|
export interface ChangeOrderModalProps {
|
|
8
6
|
postalCode: string;
|
|
@@ -13,17 +11,8 @@ export interface ChangeOrderModalProps {
|
|
|
13
11
|
isClubClient?: boolean;
|
|
14
12
|
orderFormId: string;
|
|
15
13
|
saveSelectedSimilarProduct?: (similarProduct: SimilarProductsProps | undefined) => void;
|
|
16
|
-
getOrderFormMutation?: (variables: {}) => Promise<CustomDataMutationResponse>;
|
|
17
|
-
getProductsSimilarsMutation?: (variables: {}) => Promise<GetProductsSimilarsResponse>;
|
|
18
|
-
postChangeOrderMutation?: (variables: {}) => Promise<PostChangeOrderMutationResponse>;
|
|
19
|
-
}
|
|
20
|
-
interface CustomDataMutationResponse {
|
|
21
|
-
getOrderForm: {
|
|
22
|
-
data: string;
|
|
23
|
-
};
|
|
24
14
|
}
|
|
25
15
|
export interface idSubstitutionCriteriasProps {
|
|
26
16
|
[key: string]: string;
|
|
27
17
|
}
|
|
28
|
-
export declare const ChangeOrderModal: ({ selectedItem, postalCode, orderFormId, isClubClient, isOpen, environment, setIsOpen, saveSelectedSimilarProduct
|
|
29
|
-
export {};
|
|
18
|
+
export declare const ChangeOrderModal: ({ selectedItem, postalCode, orderFormId, isClubClient, isOpen, environment, setIsOpen, saveSelectedSimilarProduct }: ChangeOrderModalProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,116 +1,105 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { useState as
|
|
3
|
-
import { Modal as
|
|
4
|
-
import { ProductSelected as
|
|
5
|
-
import { SimilarProducts as
|
|
6
|
-
import { ModalFooter as
|
|
7
|
-
/* empty css
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
const
|
|
1
|
+
import { jsx as n, jsxs as j, Fragment as q } from "react/jsx-runtime";
|
|
2
|
+
import { useState as e, useEffect as w } from "react";
|
|
3
|
+
import { Modal as M } from "../Modal/Modal.js";
|
|
4
|
+
import { ProductSelected as N } from "./components/ProductSelected.js";
|
|
5
|
+
import { SimilarProducts as k } from "./components/SimilarProducts.js";
|
|
6
|
+
import { ModalFooter as v } from "./components/ModalFooter.js";
|
|
7
|
+
/* empty css */import { Skeleton as A } from "@acctglobal/skeleton";
|
|
8
|
+
import { getProductsSimilars as E } from "./api/getProductsSimilars.js";
|
|
9
|
+
import _ from "../../hooks/useAnalitcsEvents.js";
|
|
10
|
+
import { NoSimilarProduct as J } from "./components/NoSimilarProduct.js";
|
|
11
|
+
import { getOrderForm as L } from "./api/getOrderForm.js";
|
|
12
|
+
import { postChangeOrder as T } from "./api/postChangeOrder.js";
|
|
13
|
+
const oo = ({
|
|
14
14
|
selectedItem: o,
|
|
15
15
|
postalCode: S,
|
|
16
|
-
orderFormId:
|
|
17
|
-
isClubClient:
|
|
16
|
+
orderFormId: f,
|
|
17
|
+
isClubClient: h,
|
|
18
18
|
isOpen: y,
|
|
19
|
-
environment:
|
|
20
|
-
setIsOpen:
|
|
21
|
-
saveSelectedSimilarProduct:
|
|
22
|
-
getOrderFormMutation: l,
|
|
23
|
-
getProductsSimilarsMutation: C,
|
|
24
|
-
postChangeOrderMutation: F
|
|
19
|
+
environment: O,
|
|
20
|
+
setIsOpen: l,
|
|
21
|
+
saveSelectedSimilarProduct: m
|
|
25
22
|
}) => {
|
|
26
|
-
const [
|
|
27
|
-
|
|
23
|
+
const [u, b] = e(), [P, s] = e(!1), a = O === "io", { genericTaggingEvent: C } = _(), [r, p] = e({ itemId: "" });
|
|
24
|
+
return w(() => {
|
|
28
25
|
(async () => {
|
|
29
|
-
|
|
26
|
+
s(!0);
|
|
30
27
|
try {
|
|
31
|
-
const
|
|
28
|
+
const t = await E({
|
|
32
29
|
postalCode: S,
|
|
33
30
|
selectedItem: o,
|
|
34
|
-
isIO:
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
P(u);
|
|
31
|
+
isIO: a
|
|
32
|
+
}), d = (t == null ? void 0 : t.products) || [];
|
|
33
|
+
b(d);
|
|
38
34
|
} finally {
|
|
39
|
-
|
|
35
|
+
s(!1);
|
|
40
36
|
}
|
|
41
37
|
})(), (async () => {
|
|
42
|
-
var
|
|
43
|
-
|
|
38
|
+
var t, d;
|
|
39
|
+
s(!0);
|
|
44
40
|
try {
|
|
45
|
-
const
|
|
46
|
-
|
|
47
|
-
orderFormId: d
|
|
48
|
-
}
|
|
49
|
-
}) || { getOrderForm: { data: "" } }, e = r ? q : JSON.parse(w.getOrderForm.data), n = ((u = (i = e == null ? void 0 : e.customData) == null ? void 0 : i.customApps) == null ? void 0 : u.find(
|
|
50
|
-
(A) => A.id === "janis"
|
|
41
|
+
const c = await L(f, a), i = ((d = (t = c == null ? void 0 : c.customData) == null ? void 0 : t.customApps) == null ? void 0 : d.find(
|
|
42
|
+
(x) => x.id === "janis"
|
|
51
43
|
)) || null;
|
|
52
|
-
let
|
|
53
|
-
|
|
54
|
-
|
|
44
|
+
let g = {};
|
|
45
|
+
i != null && i.fields.idSubstitutionCriterias && (g = JSON.parse(
|
|
46
|
+
i == null ? void 0 : i.fields.idSubstitutionCriterias
|
|
55
47
|
));
|
|
56
|
-
const
|
|
57
|
-
|
|
58
|
-
itemId: `${
|
|
48
|
+
const F = o == null ? void 0 : o.productOriginId;
|
|
49
|
+
p({
|
|
50
|
+
itemId: `${g[F]}`
|
|
59
51
|
});
|
|
60
52
|
} finally {
|
|
61
|
-
|
|
53
|
+
s(!1);
|
|
62
54
|
}
|
|
63
55
|
})();
|
|
64
|
-
}, [])
|
|
65
|
-
|
|
66
|
-
H(
|
|
67
|
-
d,
|
|
68
|
-
r,
|
|
69
|
-
o.productOriginId,
|
|
70
|
-
t.itemId,
|
|
71
|
-
F
|
|
72
|
-
), t && (c == null || c(t), N("salvar_substituto", {
|
|
73
|
-
name: o.name,
|
|
74
|
-
replacement_item: t == null ? void 0 : t.name
|
|
75
|
-
})), p(!1);
|
|
76
|
-
};
|
|
77
|
-
return /* @__PURE__ */ a(
|
|
78
|
-
_,
|
|
56
|
+
}, []), /* @__PURE__ */ n(
|
|
57
|
+
M,
|
|
79
58
|
{
|
|
80
59
|
isOpen: y,
|
|
81
|
-
setIsOpen:
|
|
60
|
+
setIsOpen: l,
|
|
82
61
|
className: "change-order-modal",
|
|
83
62
|
title: "Produto com estoque baixo",
|
|
84
|
-
Footer:
|
|
85
|
-
|
|
63
|
+
Footer: /* @__PURE__ */ n(
|
|
64
|
+
v,
|
|
86
65
|
{
|
|
87
|
-
saveSelectedSimilarProduct:
|
|
66
|
+
saveSelectedSimilarProduct: () => {
|
|
67
|
+
T(
|
|
68
|
+
f,
|
|
69
|
+
a,
|
|
70
|
+
o.productOriginId,
|
|
71
|
+
r.itemId
|
|
72
|
+
), r && (m == null || m(r), C("salvar_substituto", {
|
|
73
|
+
name: o.name,
|
|
74
|
+
replacement_item: r == null ? void 0 : r.name
|
|
75
|
+
})), l(!1);
|
|
76
|
+
}
|
|
88
77
|
}
|
|
89
78
|
),
|
|
90
|
-
children:
|
|
91
|
-
|
|
79
|
+
children: P ? /* @__PURE__ */ n(
|
|
80
|
+
A,
|
|
92
81
|
{
|
|
93
|
-
width:
|
|
94
|
-
height:
|
|
82
|
+
width: a ? "100%" : "90%",
|
|
83
|
+
height: a ? 600 : 425,
|
|
95
84
|
backgroundColor: "var(--color-grayScale-faded)",
|
|
96
85
|
margin: "auto",
|
|
97
86
|
animation: !0
|
|
98
87
|
}
|
|
99
|
-
) : /* @__PURE__ */
|
|
100
|
-
o && /* @__PURE__ */
|
|
101
|
-
|
|
102
|
-
|
|
88
|
+
) : /* @__PURE__ */ j(q, { children: [
|
|
89
|
+
o && /* @__PURE__ */ n(N, { selectedItem: o }),
|
|
90
|
+
u && u.length > 0 ? /* @__PURE__ */ n(
|
|
91
|
+
k,
|
|
103
92
|
{
|
|
104
|
-
isClubClient:
|
|
105
|
-
similarProductSelect:
|
|
106
|
-
setSimilarProductSelect:
|
|
107
|
-
products:
|
|
93
|
+
isClubClient: h,
|
|
94
|
+
similarProductSelect: r,
|
|
95
|
+
setSimilarProductSelect: p,
|
|
96
|
+
products: u
|
|
108
97
|
}
|
|
109
|
-
) : /* @__PURE__ */
|
|
98
|
+
) : /* @__PURE__ */ n(J, {})
|
|
110
99
|
] })
|
|
111
100
|
}
|
|
112
101
|
);
|
|
113
102
|
};
|
|
114
103
|
export {
|
|
115
|
-
|
|
104
|
+
oo as ChangeOrderModal
|
|
116
105
|
};
|
|
@@ -1,12 +1,21 @@
|
|
|
1
|
-
import
|
|
2
|
-
const c = async (
|
|
1
|
+
import o from "axios";
|
|
2
|
+
const c = async (t, a) => {
|
|
3
3
|
try {
|
|
4
|
-
if (
|
|
5
|
-
const { data:
|
|
6
|
-
`/api/checkout/pub/orderForm/${
|
|
4
|
+
if (a) {
|
|
5
|
+
const { data: e } = await o.post(
|
|
6
|
+
`/api/checkout/pub/orderForm/${t}`
|
|
7
7
|
);
|
|
8
|
-
return
|
|
8
|
+
return e;
|
|
9
9
|
}
|
|
10
|
+
const { data: r } = await o.post("/api/proxy", {
|
|
11
|
+
targetUrl: `/api/checkout/pub/orderForm/${t}`,
|
|
12
|
+
method: "GET",
|
|
13
|
+
headers: {
|
|
14
|
+
"Content-Type": "application/json",
|
|
15
|
+
Accept: "application/json"
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
return r;
|
|
10
19
|
} catch (r) {
|
|
11
20
|
console.error("Error in Change Order Modal", r);
|
|
12
21
|
}
|
|
@@ -4,12 +4,9 @@ interface GetProductsSimilarsProps {
|
|
|
4
4
|
postalCode: string;
|
|
5
5
|
isIO: boolean;
|
|
6
6
|
selectedItem: SelectedItemProps;
|
|
7
|
-
getProductsSimilarsMutation?: (variables: {}) => Promise<GetProductsSimilarsResponse>;
|
|
8
7
|
}
|
|
9
|
-
export
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
}
|
|
14
|
-
export declare const getProductsSimilars: ({ postalCode, isIO, selectedItem, getProductsSimilarsMutation }: GetProductsSimilarsProps) => Promise<any>;
|
|
8
|
+
export declare const getProductsSimilars: ({ postalCode, isIO, selectedItem }: GetProductsSimilarsProps) => Promise<{
|
|
9
|
+
productOrigin: string;
|
|
10
|
+
products: import('../../../main').SimilarProducts[];
|
|
11
|
+
} | undefined>;
|
|
15
12
|
export {};
|
|
@@ -1,34 +1,33 @@
|
|
|
1
|
-
import
|
|
2
|
-
const
|
|
3
|
-
postalCode:
|
|
4
|
-
isIO:
|
|
5
|
-
selectedItem: r
|
|
6
|
-
getProductsSimilarsMutation: a
|
|
1
|
+
import n from "axios";
|
|
2
|
+
const O = async ({
|
|
3
|
+
postalCode: a,
|
|
4
|
+
isIO: p,
|
|
5
|
+
selectedItem: r
|
|
7
6
|
}) => {
|
|
8
7
|
try {
|
|
9
|
-
if (
|
|
10
|
-
const { data: o } = await
|
|
11
|
-
`/_v/commerce/products/productsSimilar?postalCode=${
|
|
12
|
-
), { similarProducts:
|
|
13
|
-
return
|
|
14
|
-
(
|
|
8
|
+
if (p) {
|
|
9
|
+
const { data: o } = await n.get(
|
|
10
|
+
`/_v/commerce/products/productsSimilar?postalCode=${a}&skus=${r == null ? void 0 : r.productOriginId}&field=sku`
|
|
11
|
+
), { similarProducts: u } = o;
|
|
12
|
+
return u.find(
|
|
13
|
+
(c) => c.productOrigin === (r == null ? void 0 : r.productOriginId)
|
|
15
14
|
);
|
|
16
15
|
}
|
|
17
|
-
const i =
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
16
|
+
const { data: i } = await n.post("/api/proxy", {
|
|
17
|
+
targetUrl: `/_v/commerce/products/productsSimilar?postalCode=${a}&skus=${r == null ? void 0 : r.productOriginId}&field=sku`,
|
|
18
|
+
method: "GET",
|
|
19
|
+
headers: {
|
|
20
|
+
"Content-Type": "application/json",
|
|
21
|
+
Accept: "application/json"
|
|
21
22
|
}
|
|
22
|
-
});
|
|
23
|
-
return
|
|
24
|
-
i == null ? void 0 : i.getProductsSimilars.data
|
|
25
|
-
).similarProducts.find(
|
|
23
|
+
}), { similarProducts: s } = i;
|
|
24
|
+
return s.find(
|
|
26
25
|
(o) => o.productOrigin === r.productOriginId
|
|
27
|
-
)
|
|
26
|
+
);
|
|
28
27
|
} catch (i) {
|
|
29
28
|
console.error("Error in Change Order Modal", i);
|
|
30
29
|
}
|
|
31
30
|
};
|
|
32
31
|
export {
|
|
33
|
-
|
|
32
|
+
O as getProductsSimilars
|
|
34
33
|
};
|
|
@@ -1,6 +1 @@
|
|
|
1
|
-
export
|
|
2
|
-
postChangeOrder: {
|
|
3
|
-
data: string;
|
|
4
|
-
};
|
|
5
|
-
}
|
|
6
|
-
export declare const postChangeOrder: (orderFormId: string, isIO: boolean, skuId: string, substitutionId: string, postChangeOrderMutation?: (variables: {}) => Promise<PostChangeOrderMutationResponse>) => Promise<any>;
|
|
1
|
+
export declare const postChangeOrder: (orderFormId: string, isIO: boolean, skuId: string, substitutionId: string) => Promise<any>;
|
|
@@ -1,26 +1,32 @@
|
|
|
1
|
-
import
|
|
2
|
-
const
|
|
1
|
+
import o from "axios";
|
|
2
|
+
const s = async (e, t, a, n) => {
|
|
3
3
|
try {
|
|
4
4
|
const r = {
|
|
5
|
-
orderFormId:
|
|
6
|
-
skuId:
|
|
7
|
-
substitutionId:
|
|
5
|
+
orderFormId: e,
|
|
6
|
+
skuId: a,
|
|
7
|
+
substitutionId: n
|
|
8
8
|
};
|
|
9
|
-
if (
|
|
10
|
-
const { data: d } = await
|
|
9
|
+
if (t) {
|
|
10
|
+
const { data: d } = await o.post(
|
|
11
11
|
"/_v/commerce/orderform/changeOrder",
|
|
12
12
|
r
|
|
13
13
|
);
|
|
14
14
|
return d;
|
|
15
15
|
}
|
|
16
|
-
const
|
|
17
|
-
|
|
16
|
+
const { data: c } = await o.post("/api/proxy", {
|
|
17
|
+
targetUrl: "/_v/commerce/orderform/changeOrder",
|
|
18
|
+
method: "POST",
|
|
19
|
+
headers: {
|
|
20
|
+
"Content-Type": "application/json",
|
|
21
|
+
Accept: "application/json"
|
|
22
|
+
},
|
|
23
|
+
body: r
|
|
18
24
|
});
|
|
19
|
-
return
|
|
25
|
+
return c;
|
|
20
26
|
} catch (r) {
|
|
21
27
|
console.error("Error in Change Order Modal", r);
|
|
22
28
|
}
|
|
23
29
|
};
|
|
24
30
|
export {
|
|
25
|
-
|
|
31
|
+
s as postChangeOrder
|
|
26
32
|
};
|
|
@@ -12,9 +12,6 @@ interface CouponsProps {
|
|
|
12
12
|
disableFirstEmptyModal?: boolean;
|
|
13
13
|
couponsList?: CouponType[];
|
|
14
14
|
qtdCouponsView?: number;
|
|
15
|
-
getCouponsMutation?: any;
|
|
16
|
-
addCouponMutation?: any;
|
|
17
|
-
removeCouponMutation?: any;
|
|
18
15
|
}
|
|
19
|
-
export declare const Coupons: ({ orderFormId, hasItemsInCart, builder, account, isIO, closeIOModal, activeOrderFormCoupon, genericTaggingEvent, disableFirstEmptyModal, couponsList, qtdCouponsView
|
|
16
|
+
export declare const Coupons: ({ orderFormId, hasItemsInCart, builder, account, isIO, closeIOModal, activeOrderFormCoupon, genericTaggingEvent, disableFirstEmptyModal, couponsList, qtdCouponsView }: CouponsProps) => import("react/jsx-runtime").JSX.Element;
|
|
20
17
|
export {};
|