@nuskin/ns-shop 7.3.0-pa-1.4 → 7.3.0-pa-1.6
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
CHANGED
|
@@ -1,11 +1,18 @@
|
|
|
1
1
|
import {UrlService} from "@nuskin/ns-util";
|
|
2
2
|
import axios from 'axios'
|
|
3
3
|
|
|
4
|
-
const downConvertAgreedToTerms = async (sapId) => {
|
|
5
|
-
let retVal =
|
|
4
|
+
const downConvertAgreedToTerms = async (sapId, authToken) => {
|
|
5
|
+
let retVal = true;
|
|
6
6
|
|
|
7
7
|
try {
|
|
8
|
-
const result = await axios.get(
|
|
8
|
+
const result = await axios.get(
|
|
9
|
+
`${UrlService.getApisUrl()}/account-enrollment/agreement-terms/${sapId}`,
|
|
10
|
+
{
|
|
11
|
+
headers: {
|
|
12
|
+
Authorization: `Bearer ${authToken}`
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
)
|
|
9
16
|
retVal = result.data.agreedTerms;
|
|
10
17
|
} catch (e) {
|
|
11
18
|
console.error('agreement-terms check failed', e)
|
|
@@ -14,12 +21,17 @@ const downConvertAgreedToTerms = async (sapId) => {
|
|
|
14
21
|
return retVal
|
|
15
22
|
}
|
|
16
23
|
|
|
17
|
-
const setDownConvertAgreedToTerms = async (sapId) => {
|
|
24
|
+
const setDownConvertAgreedToTerms = async (sapId, authToken) => {
|
|
18
25
|
let succeeded = true
|
|
19
26
|
try {
|
|
20
27
|
await axios.post(`${UrlService.getApisUrl()}/account-enrollment/agreement-terms`, {
|
|
21
28
|
agreedTerms: true,
|
|
22
29
|
sapId
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
headers: {
|
|
33
|
+
Authorization: `Bearer ${authToken}`
|
|
34
|
+
}
|
|
23
35
|
})
|
|
24
36
|
} catch (e) {
|
|
25
37
|
console.error('Failed setting agreement to terms', e);
|