@veritree/services 2.37.0 → 2.38.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 +1 -1
- package/src/endpoints/standards.js +13 -6
package/package.json
CHANGED
|
@@ -8,6 +8,13 @@ class StandardsApi extends Api {
|
|
|
8
8
|
}
|
|
9
9
|
|
|
10
10
|
themes() {
|
|
11
|
+
const single = async (id, args) => {
|
|
12
|
+
const url = `${this.getUrl()}/themes/${id}?${createParamsStringFromArgs(
|
|
13
|
+
args
|
|
14
|
+
)}`;
|
|
15
|
+
return await this.get(url);
|
|
16
|
+
};
|
|
17
|
+
|
|
11
18
|
const all = async (args) => {
|
|
12
19
|
const url = `${this.getUrl()}/themes?${createParamsStringFromArgs(args)}`;
|
|
13
20
|
return await this.get(url);
|
|
@@ -61,22 +68,22 @@ class StandardsApi extends Api {
|
|
|
61
68
|
|
|
62
69
|
const UNSDGs = (themeId) => {
|
|
63
70
|
const create = async (data) => {
|
|
64
|
-
console.log('this.getUrl:', this.getUrl())
|
|
65
71
|
const url = `${this.getUrl()}/themes/${themeId}/attach-sdg`;
|
|
66
72
|
return await this.post(url, data);
|
|
67
73
|
};
|
|
68
74
|
return {
|
|
69
|
-
create
|
|
75
|
+
create,
|
|
70
76
|
};
|
|
71
77
|
};
|
|
72
78
|
|
|
73
79
|
return {
|
|
80
|
+
single,
|
|
74
81
|
all,
|
|
75
82
|
create,
|
|
76
83
|
update,
|
|
77
84
|
delete: remove,
|
|
78
85
|
goals,
|
|
79
|
-
UNSDGs
|
|
86
|
+
UNSDGs,
|
|
80
87
|
};
|
|
81
88
|
}
|
|
82
89
|
|
|
@@ -125,14 +132,14 @@ class StandardsApi extends Api {
|
|
|
125
132
|
delete: remove,
|
|
126
133
|
};
|
|
127
134
|
}
|
|
128
|
-
UNSDGs(themeId){
|
|
135
|
+
UNSDGs(themeId) {
|
|
129
136
|
const attach = async (data) => {
|
|
130
137
|
const url = `${this.getUrl()}/themes/${themeId}/attach-sdg`;
|
|
131
|
-
return await this.update(url,{
|
|
138
|
+
return await this.update(url, { sdg_id: data });
|
|
132
139
|
};
|
|
133
140
|
|
|
134
141
|
return {
|
|
135
|
-
attach
|
|
142
|
+
attach,
|
|
136
143
|
};
|
|
137
144
|
}
|
|
138
145
|
}
|