@veritree/services 2.10.0 → 2.11.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/index.js
CHANGED
|
@@ -22,6 +22,8 @@ import { TreeOrders } from './src/endpoints/trees-orders';
|
|
|
22
22
|
import { User } from './src/endpoints/user';
|
|
23
23
|
import { Users } from './src/endpoints/users';
|
|
24
24
|
import { Roles } from './src/endpoints/roles';
|
|
25
|
+
import { FieldReports } from './src/endpoints/field-reports';
|
|
26
|
+
import { ExternalReports } from './src/endpoints/external-reports';
|
|
25
27
|
|
|
26
28
|
export {
|
|
27
29
|
BulkUploads,
|
|
@@ -48,4 +50,6 @@ export {
|
|
|
48
50
|
User,
|
|
49
51
|
Users,
|
|
50
52
|
Roles,
|
|
53
|
+
FieldReports,
|
|
54
|
+
ExternalReports
|
|
51
55
|
};
|
package/package.json
CHANGED
package/src/endpoints/images.js
CHANGED
|
@@ -16,6 +16,29 @@ class SubsitesApi extends Api {
|
|
|
16
16
|
get,
|
|
17
17
|
};
|
|
18
18
|
}
|
|
19
|
+
|
|
20
|
+
indicators() {
|
|
21
|
+
const all = async (subsite) => {
|
|
22
|
+
const url = `${this.getUrl()}/${subsite}/indicators`;
|
|
23
|
+
return await this.get(url);
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
const create = async (subsite, formData) => {
|
|
27
|
+
const url = `${this.getUrl()}/${subsite}/indicators`;
|
|
28
|
+
return await this.post(url, formData);
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
const deleteFromSubsite = async (subsite, indicator) => {
|
|
32
|
+
const url = `${this.getUrl()}/${subsite}/indicators/${indicator}`;
|
|
33
|
+
return await this.post(url, null, 'delete');
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
return {
|
|
37
|
+
all,
|
|
38
|
+
create,
|
|
39
|
+
deleteFromSubsite,
|
|
40
|
+
};
|
|
41
|
+
}
|
|
19
42
|
}
|
|
20
43
|
|
|
21
|
-
export const Subsites = new SubsitesApi();
|
|
44
|
+
export const Subsites = new SubsitesApi();
|
package/src/helpers/relations.js
CHANGED
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
const Relations = (api,
|
|
2
|
-
let url = `${api.baseUrl}/${
|
|
1
|
+
const Relations = (api, relationPrefix, relationId) => {
|
|
2
|
+
let url = `${api.baseUrl}/${relationPrefix}/${relationId}/${api.resource}`;
|
|
3
3
|
|
|
4
4
|
const all = async (args) => {
|
|
5
5
|
url = `${url}${api.getUrlParams(args)}`;
|
|
6
6
|
return await api.get(url);
|
|
7
7
|
};
|
|
8
8
|
|
|
9
|
-
const single = async (
|
|
10
|
-
url = `${url}/${
|
|
9
|
+
const single = async (id, args) => {
|
|
10
|
+
url = `${url}/${id}${api.getUrlParams(args)}`;
|
|
11
11
|
return await api.get(url);
|
|
12
12
|
};
|
|
13
13
|
|
|
14
|
-
const attach = async (
|
|
15
|
-
url = `${url}/${
|
|
14
|
+
const attach = async (id, data, args) => {
|
|
15
|
+
url = `${url}/${id}/attach${api.getUrlParams(args)}`;
|
|
16
16
|
return await api.post(url, data);
|
|
17
17
|
};
|
|
18
18
|
|
|
19
|
-
const detach = async (
|
|
20
|
-
url = `${url}/${
|
|
19
|
+
const detach = async (id, args) => {
|
|
20
|
+
url = `${url}/${id}/detach${api.getUrlParams(args)}`;
|
|
21
21
|
return await api.post(url, null, "delete");
|
|
22
22
|
};
|
|
23
23
|
|