eservices-core 1.0.300 → 1.0.301
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/dist/index.js +12 -1
- package/dist/services/data-service.d.ts +3 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* eservices-core v1.0.
|
|
2
|
+
* eservices-core v1.0.301
|
|
3
3
|
* (c) 2022 ESERVICES
|
|
4
4
|
*/
|
|
5
5
|
'use strict';
|
|
@@ -3168,7 +3168,18 @@ class dataService {
|
|
|
3168
3168
|
if (typeof fields === 'object')
|
|
3169
3169
|
return add(Object.keys(fields).join(' '));
|
|
3170
3170
|
}
|
|
3171
|
+
function appendOrder(query, order) {
|
|
3172
|
+
if (!order)
|
|
3173
|
+
return;
|
|
3174
|
+
if (!Object.keys(order).length)
|
|
3175
|
+
return;
|
|
3176
|
+
const orderStr = Object.entries(order)
|
|
3177
|
+
.map(([name, direction]) => `@${name} ${direction}`)
|
|
3178
|
+
.join(',');
|
|
3179
|
+
query.append('order', orderStr);
|
|
3180
|
+
}
|
|
3171
3181
|
appendFieldsParam(queryUrl, options.fields);
|
|
3182
|
+
appendOrder(queryUrl, options.order);
|
|
3172
3183
|
let result = yield Request(`/close-api/data/${entity}?${queryUrl.toString()}`, {
|
|
3173
3184
|
method: 'GET',
|
|
3174
3185
|
headers: {
|