@veritree/services 2.43.0 → 2.45.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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@veritree/services",
3
- "version": "2.43.0",
3
+ "version": "2.45.0",
4
4
  "description": "A collection of javascript functions/services to talk to veritree API",
5
5
  "type": "module",
6
6
  "main": "index.js",
@@ -37,10 +37,14 @@ class FieldReportsApi extends Api {
37
37
  }
38
38
 
39
39
  initiatives(fieldReportId, params) {
40
- const url = `${this.getUrl()}/${fieldReportId}/initiatives${this.getUrlParams(
41
- params
42
- )}`;
43
- return this.get(url);
40
+ const all = async () => {
41
+ const url = `${this.getUrl()}/${fieldReportId}/initiatives${this.getUrlParams(
42
+ params
43
+ )}`;
44
+ return await this.get(url);
45
+ };
46
+
47
+ return { all };
44
48
  }
45
49
 
46
50
  attachInitiatives(fieldReportId, formData, params) {
@@ -56,6 +60,15 @@ class FieldReportsApi extends Api {
56
60
  )}`;
57
61
  return this.post(url, formData, null, params);
58
62
  }
63
+
64
+ phases() {
65
+ const all = async () => {
66
+ const url = `${this.getUrl()}/phases`;
67
+ return await this.get(url);
68
+ };
69
+
70
+ return { all };
71
+ }
59
72
  }
60
73
 
61
74
  export const FieldReports = new FieldReportsApi();
@@ -93,8 +93,8 @@ class StandardsApi extends Api {
93
93
  return await this.get(url);
94
94
  };
95
95
 
96
- const update = async (data) => {
97
- const url = `${this.getUrl()}/goals/${goalId}`;
96
+ const update = async (data, args) => {
97
+ const url = `${this.getUrl()}/goals/${goalId}${this.getUrlParams(args)}`;
98
98
  return await this.post(url, data, 'patch');
99
99
  };
100
100