sysone-api-mapper 1.0.69 → 1.0.70
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/package.json +1 -1
- package/src/mapper/Mapper.js +11 -6
package/package.json
CHANGED
package/src/mapper/Mapper.js
CHANGED
|
@@ -20,10 +20,14 @@ const getApiMapperConfig = () => {
|
|
|
20
20
|
|
|
21
21
|
};
|
|
22
22
|
|
|
23
|
-
const
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
23
|
+
const getSalesAgent = () => {
|
|
24
|
+
return localStorage.getItem("sales-channel") ||
|
|
25
|
+
window.__INTERMEDIARY_CODE__ ||
|
|
26
|
+
null;
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
const getSalesChannel = () => {
|
|
30
|
+
return localStorage.getItem("branch-code") ||
|
|
27
31
|
window.__INTERMEDIARY_CODE__ ||
|
|
28
32
|
null;
|
|
29
33
|
};
|
|
@@ -35,11 +39,12 @@ const getDynamicHeaders = (tenant) => {
|
|
|
35
39
|
window.__INTERMEDIARY_CODE__ ||
|
|
36
40
|
configs.cnp.headers["X-Agent"];
|
|
37
41
|
|
|
38
|
-
const salesCode =
|
|
42
|
+
const salesCode = getSalesAgent();
|
|
43
|
+
const salesChannel = getSalesChannel()
|
|
39
44
|
|
|
40
45
|
return {
|
|
41
46
|
"X-Agent": xAgent,
|
|
42
|
-
"X-Sales-Channel":
|
|
47
|
+
"X-Sales-Channel": salesChannel || xAgent,
|
|
43
48
|
"X-Sales-Agent": salesCode || xAgent
|
|
44
49
|
};
|
|
45
50
|
}
|