@veritree/services 2.10.0 → 2.11.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/index.js +4 -0
- package/package.json +1 -1
- package/src/endpoints/external-reports.js +10 -0
- package/src/endpoints/field-reports.js +10 -0
- package/src/endpoints/subsites.js +24 -1
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
|
@@ -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();
|