@veritree/services 2.20.0 → 2.21.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.20.0",
3
+ "version": "2.21.0",
4
4
  "description": "A collection of javascript functions/services to talk to veritree API",
5
5
  "type": "module",
6
6
  "main": "index.js",
@@ -55,21 +55,32 @@ class SubsitesApi extends Api {
55
55
  }
56
56
 
57
57
  evidence(subsiteId, params) {
58
- const url = `${this.getUrl()}/${subsiteId}/evidence${this.getUrlParams(
59
- params
60
- )}`;
58
+ let url = `${this.getUrl()}/${subsiteId}/evidence`;
61
59
 
62
60
  const all = async () => {
61
+ url = `${url}${this.getUrlParams(params)}`;
62
+
63
63
  return await this.get(url);
64
64
  };
65
65
 
66
66
  const attach = async (formData) => {
67
+ url = `${url}${this.getUrlParams(params)}`;
68
+
67
69
  return await this.post(url, formData);
68
70
  };
69
71
 
72
+ const remove = async (evidenceType, evidenceId) => {
73
+ url = `${url}/${evidenceType}/${evidenceId}${this.getUrlParams(
74
+ params
75
+ )}`;
76
+
77
+ return await this.post(url, null, "delete");
78
+ };
79
+
70
80
  return {
71
81
  all,
72
82
  attach,
83
+ delete: remove,
73
84
  };
74
85
  }
75
86
  }