@timum/timum_pdk 1.0.12 → 1.0.14
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/index.js +18 -2
package/package.json
CHANGED
package/src/index.js
CHANGED
|
@@ -2,8 +2,17 @@ import { createApi, fetchBaseQuery } from "@reduxjs/toolkit/query/react";
|
|
|
2
2
|
|
|
3
3
|
import { reactLocalStorage } from "reactjs-localstorage";
|
|
4
4
|
|
|
5
|
+
const host = undefined;
|
|
6
|
+
export const setTimumApiHost = (url) => {
|
|
7
|
+
host = url;
|
|
8
|
+
};
|
|
9
|
+
|
|
5
10
|
export const getTimumApiHost = () => {
|
|
6
|
-
|
|
11
|
+
if (host) {
|
|
12
|
+
return host;
|
|
13
|
+
} else {
|
|
14
|
+
return reactLocalStorage.get("timumApiHost", "https://www.timum.de");
|
|
15
|
+
}
|
|
7
16
|
};
|
|
8
17
|
|
|
9
18
|
// we do it this way so that the base url can be determined dynamically
|
|
@@ -53,6 +62,7 @@ export const timumApiSlice = createApi({
|
|
|
53
62
|
`/resources/${props.channelOrResourceId}/upcoming_bookables`,
|
|
54
63
|
props
|
|
55
64
|
),
|
|
65
|
+
headers: props.headers,
|
|
56
66
|
}),
|
|
57
67
|
providesTags: (/* result = [], error, arg */) => ["Timeslot"],
|
|
58
68
|
}),
|
|
@@ -63,6 +73,7 @@ export const timumApiSlice = createApi({
|
|
|
63
73
|
`/resources/${props.channelOrResourceId}/active_products`,
|
|
64
74
|
props
|
|
65
75
|
),
|
|
76
|
+
headers: props.headers,
|
|
66
77
|
}),
|
|
67
78
|
providesTags: (/* result = [], error, arg */) => ["Product"],
|
|
68
79
|
}),
|
|
@@ -75,6 +86,7 @@ export const timumApiSlice = createApi({
|
|
|
75
86
|
),
|
|
76
87
|
method: "post",
|
|
77
88
|
body: props.body,
|
|
89
|
+
headers: props.headers,
|
|
78
90
|
}),
|
|
79
91
|
invalidatesTags: (/* result, error, arg */) => [{ type: "Timeslot" }],
|
|
80
92
|
}),
|
|
@@ -116,6 +128,7 @@ export const timumApiSlice = createApi({
|
|
|
116
128
|
`/resources/${props.channelOrResourceId}/public_data`,
|
|
117
129
|
props
|
|
118
130
|
),
|
|
131
|
+
headers: props.headers,
|
|
119
132
|
}),
|
|
120
133
|
}),
|
|
121
134
|
|
|
@@ -125,8 +138,9 @@ export const timumApiSlice = createApi({
|
|
|
125
138
|
`/crms/${props.crmSlug}/resources/${props.channelOrResourceId}/customers/${props.personId}/identify`,
|
|
126
139
|
props
|
|
127
140
|
),
|
|
141
|
+
headers: props.headers,
|
|
128
142
|
}),
|
|
129
|
-
keepUnusedDataFor: 9999999, // once
|
|
143
|
+
keepUnusedDataFor: 9999999, // once identified it's not going to change
|
|
130
144
|
}),
|
|
131
145
|
|
|
132
146
|
/**
|
|
@@ -147,6 +161,7 @@ export const timumApiSlice = createApi({
|
|
|
147
161
|
),
|
|
148
162
|
method: "post",
|
|
149
163
|
body: props.body,
|
|
164
|
+
headers: props.headers,
|
|
150
165
|
}),
|
|
151
166
|
}),
|
|
152
167
|
|
|
@@ -163,6 +178,7 @@ export const timumApiSlice = createApi({
|
|
|
163
178
|
),
|
|
164
179
|
method: "post",
|
|
165
180
|
body: props.body,
|
|
181
|
+
headers: props.headers,
|
|
166
182
|
}),
|
|
167
183
|
}),
|
|
168
184
|
|