@veritree/services 2.24.0 → 2.24.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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@veritree/services",
3
- "version": "2.24.0",
3
+ "version": "2.24.1",
4
4
  "description": "A collection of javascript functions/services to talk to veritree API",
5
5
  "type": "module",
6
6
  "main": "index.js",
@@ -18,6 +18,35 @@ class PlantingSitesApi extends Api {
18
18
  all
19
19
  }
20
20
  }
21
+
22
+ images(subsiteId) {
23
+ let url = `${this.getUrl()}/${subsiteId}/media/images`
24
+
25
+ const attach = async (data, params) => {
26
+ url = `${url}${this.getUrlParams(params)}`;
27
+
28
+ return await this.post(url, data);
29
+ };
30
+
31
+ return {
32
+ attach
33
+ }
34
+ }
35
+
36
+ attachments(subsiteId) {
37
+ let url = `${this.getUrl()}/${subsiteId}/media/attachments`
38
+
39
+ const attach = async (data, params) => {
40
+ url = `${url}${this.getUrlParams(params)}`;
41
+
42
+ return await this.post(url, data);
43
+ };
44
+
45
+ return {
46
+ attach
47
+ }
48
+ }
49
+
21
50
  }
22
51
 
23
52
  export const PlantingSites = new PlantingSitesApi();