@veritree/services 2.79.0 → 2.81.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.79.0",
3
+ "version": "2.81.0",
4
4
  "description": "A collection of javascript functions/services to talk to veritree API",
5
5
  "type": "module",
6
6
  "main": "index.js",
@@ -51,11 +51,13 @@ class EvidenceApi extends Api {
51
51
  };
52
52
 
53
53
  const update = async (data) => {
54
- return await this.post(url, data, 'patch');
54
+ const urlWithParams = `${url}${this.getUrlParams()}`;
55
+ return await this.post(urlWithParams, data, 'patch');
55
56
  };
56
57
 
57
58
  const remove = async () => {
58
- return await this.post(url, null, 'delete');
59
+ const urlWithParams = `${url}${this.getUrlParams()}`;
60
+ return await this.post(urlWithParams, null, 'delete');
59
61
  };
60
62
 
61
63
  return {
@@ -133,9 +133,21 @@ class TasksApi extends Api {
133
133
  return await this.post(url, data);
134
134
  };
135
135
 
136
+ const deleteImage = async (imageId) => {
137
+ const imageUrl = `${url}/images/${imageId}${this.getUrlParams()}`;
138
+ return await this.post(imageUrl, null, 'delete');
139
+ };
140
+
141
+ const detach = async (type, evidenceId) => {
142
+ const path = `${taskPublicId}/evidence/${type}/${evidenceId}${this.getUrlParams()}`;
143
+ return await this.delete(path);
144
+ };
145
+
136
146
  return {
137
147
  all,
138
148
  attach,
149
+ deleteImage,
150
+ detach,
139
151
  };
140
152
  }
141
153
  }