@veritree/services 2.5.6 → 2.6.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/sponsors.js +18 -3
- package/src/helpers/api.js +3 -0
- package/src/helpers/team.js +2 -2
package/package.json
CHANGED
|
@@ -9,7 +9,9 @@ class SponsorsApi extends Api {
|
|
|
9
9
|
async map() {
|
|
10
10
|
this.setOrg();
|
|
11
11
|
|
|
12
|
-
if(!this.orgId)
|
|
12
|
+
if (!this.orgId) {
|
|
13
|
+
throw new Error('No org id provided');
|
|
14
|
+
}
|
|
13
15
|
|
|
14
16
|
const url = `${this.getUrl()}/${this.orgId}/map-data`;
|
|
15
17
|
return await this.get(url);
|
|
@@ -18,7 +20,9 @@ class SponsorsApi extends Api {
|
|
|
18
20
|
async profile() {
|
|
19
21
|
this.setOrg();
|
|
20
22
|
|
|
21
|
-
if(!this.orgId)
|
|
23
|
+
if (!this.orgId) {
|
|
24
|
+
throw new Error('No org id provided');
|
|
25
|
+
}
|
|
22
26
|
|
|
23
27
|
const url = `${this.getUrl()}/${this.orgId}/profile`;
|
|
24
28
|
return await this.get(url);
|
|
@@ -32,8 +36,19 @@ class SponsorsApi extends Api {
|
|
|
32
36
|
async totalPlantingStats(args) {
|
|
33
37
|
const url = `${this.getUrl()}/total-planting-stats${this.getUrlParams(args)}`;
|
|
34
38
|
return await this.get(url);
|
|
35
|
-
}
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
async cmsToken(args) {
|
|
42
|
+
const urlParams = this.getUrlParams(args);
|
|
43
|
+
const url = `${this.getUrl()}/${this.orgId}/cms/token${urlParams}`;
|
|
44
|
+
return await this.get(url);
|
|
45
|
+
}
|
|
36
46
|
|
|
47
|
+
async cmsImageUploadUrl(args) {
|
|
48
|
+
const urlParams = this.getUrlParams(args);
|
|
49
|
+
const url = `${this.getUrl()}/${this.orgId}/cms/image-upload-url${urlParams}`;
|
|
50
|
+
return await this.get(url);
|
|
51
|
+
}
|
|
37
52
|
}
|
|
38
53
|
|
|
39
54
|
export const Sponsors = new SponsorsApi();
|
package/src/helpers/api.js
CHANGED
package/src/helpers/team.js
CHANGED
|
@@ -29,8 +29,8 @@ const Team = (api, id) => {
|
|
|
29
29
|
return await api.post(url, data, 'patch');
|
|
30
30
|
}
|
|
31
31
|
|
|
32
|
-
const remove = async (userId) => {
|
|
33
|
-
url = `${url}/${userId}${api.getUrlParams()}`;
|
|
32
|
+
const remove = async (userId, args) => {
|
|
33
|
+
url = `${url}/${userId}${api.getUrlParams(args)}`;
|
|
34
34
|
return await api.post(url, null, "delete");
|
|
35
35
|
}
|
|
36
36
|
|