@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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/index.js +18 -2
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@timum/timum_pdk",
3
- "version": "1.0.12",
3
+ "version": "1.0.14",
4
4
  "license": "MIT",
5
5
  "description": "Contains timum public and general api endpoints",
6
6
  "homepage": "https://www.timum.de",
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
- return reactLocalStorage.get("timumApiHost", "https://www.timum.de");
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 identifoed it's not going to change
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