@veritree/services 2.38.0 → 2.39.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 +28 -10
package/package.json
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import Api from
|
|
1
|
+
import Api from "../helpers/api";
|
|
2
2
|
|
|
3
3
|
class SponsorsApi extends Api {
|
|
4
4
|
constructor(resource) {
|
|
5
5
|
super(resource);
|
|
6
|
-
this.resource =
|
|
6
|
+
this.resource = "sponsors";
|
|
7
7
|
}
|
|
8
8
|
|
|
9
9
|
async map() {
|
|
10
10
|
this.setOrg();
|
|
11
11
|
|
|
12
12
|
if (!this.orgId) {
|
|
13
|
-
throw new Error(
|
|
13
|
+
throw new Error("No org id provided");
|
|
14
14
|
}
|
|
15
15
|
|
|
16
16
|
const url = `${this.getUrl()}/${this.orgId}/map-data`;
|
|
@@ -21,7 +21,7 @@ class SponsorsApi extends Api {
|
|
|
21
21
|
this.setOrg();
|
|
22
22
|
|
|
23
23
|
if (!this.orgId) {
|
|
24
|
-
throw new Error(
|
|
24
|
+
throw new Error("No org id provided");
|
|
25
25
|
}
|
|
26
26
|
|
|
27
27
|
const url = `${this.getUrl()}/${this.orgId}/profile`;
|
|
@@ -49,7 +49,9 @@ class SponsorsApi extends Api {
|
|
|
49
49
|
};
|
|
50
50
|
|
|
51
51
|
const imageUploadUrl = async () => {
|
|
52
|
-
const url = `${this.getUrl()}/${
|
|
52
|
+
const url = `${this.getUrl()}/${
|
|
53
|
+
this.orgId
|
|
54
|
+
}/cms/image-upload-url${urlParams}`;
|
|
53
55
|
return await this.get(url);
|
|
54
56
|
};
|
|
55
57
|
|
|
@@ -67,19 +69,35 @@ class SponsorsApi extends Api {
|
|
|
67
69
|
|
|
68
70
|
tools(args) {
|
|
69
71
|
const get = async (sponsorId) => {
|
|
70
|
-
const url = `${this.getUrl()}/${sponsorId}/tools${this.getUrlParams(
|
|
72
|
+
const url = `${this.getUrl()}/${sponsorId}/tools${this.getUrlParams(
|
|
73
|
+
args
|
|
74
|
+
)}`;
|
|
71
75
|
return await this.get(url);
|
|
72
|
-
}
|
|
76
|
+
};
|
|
73
77
|
|
|
74
78
|
const create = async (sponsorId, data) => {
|
|
75
79
|
const url = `${this.getUrl()}/${sponsorId}/tools`;
|
|
76
80
|
return await this.post(url, data);
|
|
77
|
-
}
|
|
81
|
+
};
|
|
78
82
|
|
|
79
83
|
return {
|
|
80
84
|
get,
|
|
81
|
-
create
|
|
82
|
-
}
|
|
85
|
+
create,
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
treeOrderSummary(args) {
|
|
90
|
+
const all = async (sponsorId) => {
|
|
91
|
+
const url = `${this.getUrl()}/${sponsorId}/tree-order-summary${this.getUrlParams(
|
|
92
|
+
args
|
|
93
|
+
)}`;
|
|
94
|
+
|
|
95
|
+
return await this.get(url);
|
|
96
|
+
};
|
|
97
|
+
|
|
98
|
+
return {
|
|
99
|
+
all,
|
|
100
|
+
};
|
|
83
101
|
}
|
|
84
102
|
}
|
|
85
103
|
|