dce-reactkit 3.7.38 → 3.8.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/dist/cjs/index.js +12 -1
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/index.js +12 -1
- package/dist/esm/index.js.map +1 -1
- package/package.json +1 -1
- package/src/helpers/visitServerEndpoint.tsx +15 -1
package/dist/esm/index.js
CHANGED
|
@@ -769,10 +769,21 @@ const visitServerEndpoint = (opts) => __awaiter(void 0, void 0, void 0, function
|
|
|
769
769
|
if (opts.params) {
|
|
770
770
|
params = Object.fromEntries(Object
|
|
771
771
|
.entries(opts.params)
|
|
772
|
-
.filter(([
|
|
772
|
+
.filter(([, value]) => {
|
|
773
773
|
return value !== undefined;
|
|
774
774
|
}));
|
|
775
775
|
}
|
|
776
|
+
// Automatically JSONify arrays and objects
|
|
777
|
+
if (params) {
|
|
778
|
+
params = Object.fromEntries(Object
|
|
779
|
+
.entries(params)
|
|
780
|
+
.map(([key, value]) => {
|
|
781
|
+
if (Array.isArray(value) || typeof value === 'object') {
|
|
782
|
+
return [key, JSON.stringify(value)];
|
|
783
|
+
}
|
|
784
|
+
return [key, value];
|
|
785
|
+
}));
|
|
786
|
+
}
|
|
776
787
|
// Send the request
|
|
777
788
|
const sendRequest = yield getSendRequest();
|
|
778
789
|
const response = yield sendRequest({
|