@veritree/services 1.4.0 → 1.5.0-0
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/helpers/api.js +4 -4
package/package.json
CHANGED
package/src/helpers/api.js
CHANGED
|
@@ -8,13 +8,13 @@ import { getSession } from "./session";
|
|
|
8
8
|
* @param {string} url
|
|
9
9
|
* @returns {string} url
|
|
10
10
|
*/
|
|
11
|
-
function
|
|
11
|
+
function addVersionArg(url) {
|
|
12
12
|
if (!url || url.includes("_result=1")) return url;
|
|
13
13
|
|
|
14
14
|
const urlHasArgs = url.includes("?");
|
|
15
|
-
const
|
|
15
|
+
const urlVersionArg = urlHasArgs ? "&_v=5.0.0" : "?_v=5.0.0";
|
|
16
16
|
|
|
17
|
-
return `${url}${
|
|
17
|
+
return `${url}${urlVersionArg}`;
|
|
18
18
|
}
|
|
19
19
|
|
|
20
20
|
/**
|
|
@@ -183,7 +183,7 @@ export default class Api {
|
|
|
183
183
|
* @returns {object} envelope
|
|
184
184
|
*/
|
|
185
185
|
async unWrap(url, method = "get", data, as) {
|
|
186
|
-
url =
|
|
186
|
+
url = addVersionArg(url);
|
|
187
187
|
const config = getConfig(method, data, as);
|
|
188
188
|
const response = await fetch(url, config);
|
|
189
189
|
|