@veritree/services 2.18.0 → 2.18.1-1
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
|
@@ -6,8 +6,8 @@ class FieldReportsApi extends Api {
|
|
|
6
6
|
this.resource = "field-reports";
|
|
7
7
|
}
|
|
8
8
|
|
|
9
|
-
evidence(fieldReportId) {
|
|
10
|
-
const url = `${this.getUrl()}/${fieldReportId}/evidence${this.getUrlParams()}`;
|
|
9
|
+
evidence(fieldReportId, params) {
|
|
10
|
+
const url = `${this.getUrl()}/${fieldReportId}/evidence${this.getUrlParams(params)}`;
|
|
11
11
|
|
|
12
12
|
const all = async () => {
|
|
13
13
|
return await this.get(url);
|
package/src/helpers/api.js
CHANGED
|
@@ -11,8 +11,9 @@ import { getSession } from './session';
|
|
|
11
11
|
function addVersionArg(url) {
|
|
12
12
|
if (!url || url.includes('_result=1')) return url;
|
|
13
13
|
|
|
14
|
+
const version = process.env.API_VERITREE_VERSION || '5.0.0';
|
|
14
15
|
const urlHasArgs = url.includes('?');
|
|
15
|
-
const urlVersionArg = urlHasArgs ?
|
|
16
|
+
const urlVersionArg = urlHasArgs ? `&_v=${version}` : `?_v=${version}`;
|
|
16
17
|
|
|
17
18
|
return `${url}${urlVersionArg}`;
|
|
18
19
|
}
|