ublo-lib 1.25.17 → 1.25.18
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.
|
@@ -23,6 +23,8 @@ function MagicBox({
|
|
|
23
23
|
maxDays = Infinity,
|
|
24
24
|
allowedActivities,
|
|
25
25
|
categories,
|
|
26
|
+
msemApiHost = "https://services.msem.tech/api/esf",
|
|
27
|
+
msemAdminHost = "https://admin.mon-sejour-en-montagne.com/api/gesco",
|
|
26
28
|
children
|
|
27
29
|
}) {
|
|
28
30
|
const [filters, setFilters] = React.useState();
|
|
@@ -55,11 +57,12 @@ function MagicBox({
|
|
|
55
57
|
to: stayTo
|
|
56
58
|
} = stay;
|
|
57
59
|
const [welcomeResult, paramsResult] = await Promise.all([API.fetchWelcome({
|
|
60
|
+
msemApiHost,
|
|
58
61
|
lang,
|
|
59
62
|
resort,
|
|
60
63
|
stayFrom,
|
|
61
64
|
stayTo
|
|
62
|
-
}), API.fetchParams(lang, resort, merchant, channel, categories)]);
|
|
65
|
+
}), API.fetchParams(msemAdminHost, lang, resort, merchant, channel, categories)]);
|
|
63
66
|
const {
|
|
64
67
|
season: currentSeason,
|
|
65
68
|
availableSeasons
|
|
@@ -69,6 +72,7 @@ function MagicBox({
|
|
|
69
72
|
} = paramsResult;
|
|
70
73
|
const season = currentSeason || availableSeasons[0] || "2022";
|
|
71
74
|
const filtersResult = await API.fetchFilters({
|
|
75
|
+
msemApiHost,
|
|
72
76
|
lang,
|
|
73
77
|
resort,
|
|
74
78
|
season,
|
|
@@ -120,7 +124,7 @@ function MagicBox({
|
|
|
120
124
|
} : newFilters;
|
|
121
125
|
setFilters(allFilters);
|
|
122
126
|
}
|
|
123
|
-
}, [allowedActivities, categories, channel, lang, maxDays, merchant, minDays, resort, stay]);
|
|
127
|
+
}, [allowedActivities, categories, channel, lang, maxDays, merchant, minDays, msemAdminHost, msemApiHost, resort, stay]);
|
|
124
128
|
const initValues = React.useCallback(() => {
|
|
125
129
|
if (!values) {
|
|
126
130
|
const defaultValues = getDefaultValues(filters);
|
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
import * as Fetcher from "../../../../common/utils/fetcher";
|
|
2
|
-
const velApi = "https://services.msem.tech/api/esf";
|
|
3
|
-
const msemAdminApi = "https://admin.mon-sejour-en-montagne.com/api/gesco";
|
|
4
2
|
export function fetchWelcome({
|
|
3
|
+
msemApiHost,
|
|
5
4
|
lang,
|
|
6
5
|
resort,
|
|
7
6
|
stayFrom,
|
|
8
7
|
stayTo
|
|
9
8
|
}) {
|
|
10
|
-
return Fetcher.post(`${
|
|
9
|
+
return Fetcher.post(`${msemApiHost}/welcome`, {
|
|
11
10
|
resort,
|
|
12
11
|
lang,
|
|
13
12
|
stayFrom,
|
|
@@ -15,6 +14,7 @@ export function fetchWelcome({
|
|
|
15
14
|
});
|
|
16
15
|
}
|
|
17
16
|
export async function fetchFilters({
|
|
17
|
+
msemApiHost,
|
|
18
18
|
lang,
|
|
19
19
|
resort,
|
|
20
20
|
season,
|
|
@@ -23,7 +23,7 @@ export async function fetchFilters({
|
|
|
23
23
|
kinds = ["CP"],
|
|
24
24
|
engagement = true
|
|
25
25
|
}) {
|
|
26
|
-
return Fetcher.post(`${
|
|
26
|
+
return Fetcher.post(`${msemApiHost}/filters`, {
|
|
27
27
|
lang,
|
|
28
28
|
resort,
|
|
29
29
|
season,
|
|
@@ -33,8 +33,8 @@ export async function fetchFilters({
|
|
|
33
33
|
engagement
|
|
34
34
|
});
|
|
35
35
|
}
|
|
36
|
-
export async function fetchParams(lang, resort, merchant, channel, categories) {
|
|
37
|
-
const res = await fetch(`${
|
|
36
|
+
export async function fetchParams(msemAdminHost, lang, resort, merchant, channel, categories) {
|
|
37
|
+
const res = await fetch(`${msemAdminHost}/contact/parameters`, {
|
|
38
38
|
method: "POST",
|
|
39
39
|
headers: {
|
|
40
40
|
"content-type": "application/json;charset=utf-8"
|