@veritree/services 2.11.1 → 2.12.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.11.1",
3
+ "version": "2.12.0",
4
4
  "description": "A collection of javascript functions/services to talk to veritree API",
5
5
  "type": "module",
6
6
  "main": "index.js",
@@ -1,9 +1,14 @@
1
1
  import Api from '../helpers/api';
2
2
 
3
3
  class StandardsApi extends Api {
4
+ constructor(resource) {
5
+ super(resource);
6
+ this.resource = 'standards';
7
+ }
8
+
4
9
  themes() {
5
10
  const all = async () => {
6
- const url = `${this.getUrl()}standards/themes`;
11
+ const url = `${this.getUrl()}/themes`;
7
12
  return await this.get(url);
8
13
  };
9
14
 
@@ -14,7 +19,7 @@ class StandardsApi extends Api {
14
19
 
15
20
  goals() {
16
21
  const single = async (goalId) => {
17
- const url = `${this.getUrl()}standards/goals/${goalId}`;
22
+ const url = `${this.getUrl()}/goals/${goalId}`;
18
23
  return await this.get(url);
19
24
  };
20
25
 
@@ -28,7 +28,7 @@ class SubsitesApi extends Api {
28
28
  return await this.post(url, formData);
29
29
  };
30
30
 
31
- const deleteFromSubsite = async (subsite, indicator) => {
31
+ const remove = async (subsite, indicator) => {
32
32
  const url = `${this.getUrl()}/${subsite}/indicators/${indicator}`;
33
33
  return await this.post(url, null, 'delete');
34
34
  };
@@ -36,9 +36,9 @@ class SubsitesApi extends Api {
36
36
  return {
37
37
  all,
38
38
  create,
39
- deleteFromSubsite,
39
+ delete: remove,
40
40
  };
41
41
  }
42
42
  }
43
43
 
44
- export const Subsites = new SubsitesApi();
44
+ export const Subsites = new SubsitesApi();