@veritree/services 2.11.0 → 2.11.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.11.0",
3
+ "version": "2.11.1",
4
4
  "description": "A collection of javascript functions/services to talk to veritree API",
5
5
  "type": "module",
6
6
  "main": "index.js",
@@ -12,8 +12,8 @@ class ImagesApi extends Api {
12
12
  return this.update(url, data, 'patch');
13
13
  }
14
14
 
15
- relation(prefix, id) {
16
- return Relations(this, prefix, id);
15
+ relation(relationPrefix, relationId) {
16
+ return Relations(this, relationPrefix, relationId);
17
17
  }
18
18
  }
19
19
 
@@ -1,23 +1,23 @@
1
- const Relations = (api, prefix, id) => {
2
- let url = `${api.baseUrl}/${prefix}/${id}/${api.resource}`;
1
+ const Relations = (api, relationPrefix, relationId) => {
2
+ let url = `${api.baseUrl}/${relationPrefix}/${relationId}/${api.resource}`;
3
3
 
4
4
  const all = async (args) => {
5
5
  url = `${url}${api.getUrlParams(args)}`;
6
6
  return await api.get(url);
7
7
  };
8
8
 
9
- const single = async (tagId, args) => {
10
- url = `${url}/${tagId}${api.getUrlParams(args)}`;
9
+ const single = async (id, args) => {
10
+ url = `${url}/${id}${api.getUrlParams(args)}`;
11
11
  return await api.get(url);
12
12
  };
13
13
 
14
- const attach = async (tagId, data, args) => {
15
- url = `${url}/${tagId}/attach${api.getUrlParams(args)}`;
14
+ const attach = async (id, data, args) => {
15
+ url = `${url}/${id}/attach${api.getUrlParams(args)}`;
16
16
  return await api.post(url, data);
17
17
  };
18
18
 
19
- const detach = async (tagId, args) => {
20
- url = `${url}/${tagId}/detach${api.getUrlParams(args)}`;
19
+ const detach = async (id, args) => {
20
+ url = `${url}/${id}/detach${api.getUrlParams(args)}`;
21
21
  return await api.post(url, null, "delete");
22
22
  };
23
23