@veritree/services 2.67.0 → 2.69.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
|
@@ -6,6 +6,25 @@ class PlantingSitesApi extends Api {
|
|
|
6
6
|
this.resource = 'planting-sites';
|
|
7
7
|
}
|
|
8
8
|
|
|
9
|
+
public() {
|
|
10
|
+
const all = async (params) => {
|
|
11
|
+
const url = `${this.getUrl()}/public${this.getUrlParams(
|
|
12
|
+
params
|
|
13
|
+
)}`;
|
|
14
|
+
return await this.get(url);
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
const single = async (plantingSiteId) => {
|
|
18
|
+
const url = `${this.getUrl()}/public/${plantingSiteId}`;
|
|
19
|
+
return await this.get(url);
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
return {
|
|
23
|
+
all,
|
|
24
|
+
single,
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
|
|
9
28
|
users(plantingSiteId) {
|
|
10
29
|
let url = `${this.getUrl()}/${plantingSiteId}/users`;
|
|
11
30
|
|
|
@@ -129,6 +148,19 @@ class PlantingSitesApi extends Api {
|
|
|
129
148
|
all,
|
|
130
149
|
};
|
|
131
150
|
}
|
|
151
|
+
|
|
152
|
+
locations() {
|
|
153
|
+
const all = async (params) => {
|
|
154
|
+
const url = `${this.getUrl()}/locations-by-org${this.getUrlParams(
|
|
155
|
+
params
|
|
156
|
+
)}`;
|
|
157
|
+
return await this.get(url);
|
|
158
|
+
};
|
|
159
|
+
|
|
160
|
+
return {
|
|
161
|
+
all
|
|
162
|
+
}
|
|
163
|
+
}
|
|
132
164
|
}
|
|
133
165
|
|
|
134
166
|
export const PlantingSites = new PlantingSitesApi();
|
|
@@ -8,6 +8,17 @@ class TreeOrdersApi extends Api {
|
|
|
8
8
|
this.resource = "tree-orders";
|
|
9
9
|
}
|
|
10
10
|
|
|
11
|
+
cart() {
|
|
12
|
+
const create = async (data, args) => {
|
|
13
|
+
const url = `${this.getUrl()}cart${this.getUrlParams(args)}`;
|
|
14
|
+
return await this.post(url, data);
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
return {
|
|
18
|
+
create,
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
|
|
11
22
|
allocations(args) {
|
|
12
23
|
const create = async (data) => {
|
|
13
24
|
const url = `${this.getUrl()}/allocations${this.getUrlParams(args)}`;
|