impaktapps-ui-builder 0.0.18 → 0.0.19
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.
|
@@ -7771,11 +7771,14 @@ async function mergeFormdata(handlerResponse, componentName2, eventConfig, store
|
|
|
7771
7771
|
}
|
|
7772
7772
|
return { response: void 0, events: void 0 };
|
|
7773
7773
|
}
|
|
7774
|
-
const buildBodyFormat = (body2, formData) => {
|
|
7775
|
-
const finalBody = {};
|
|
7774
|
+
const buildBodyFormat = (body2, formData, userValue2) => {
|
|
7775
|
+
const finalBody = { ...userValue2 == null ? void 0 : userValue2.payload };
|
|
7776
7776
|
body2.map((elem) => {
|
|
7777
|
-
var _a;
|
|
7778
|
-
if ((_a = elem == null ? void 0 : elem.value) == null ? void 0 : _a.startsWith("$")) {
|
|
7777
|
+
var _a, _b;
|
|
7778
|
+
if ((_a = elem == null ? void 0 : elem.value) == null ? void 0 : _a.startsWith("$userValue")) {
|
|
7779
|
+
const finalpath = elem.value.substring(11);
|
|
7780
|
+
finalBody[elem.key] = _.get(userValue2, finalpath);
|
|
7781
|
+
} else if ((_b = elem == null ? void 0 : elem.value) == null ? void 0 : _b.startsWith("$")) {
|
|
7779
7782
|
const finalpath = elem.value.substring(1);
|
|
7780
7783
|
finalBody[elem.key] = _.get(formData, finalpath);
|
|
7781
7784
|
} else {
|
|
@@ -7795,14 +7798,14 @@ const buildHeadersFormat = (headers2) => {
|
|
|
7795
7798
|
return headerObj;
|
|
7796
7799
|
};
|
|
7797
7800
|
async function buildApiPayload(compConfig, body, headers, store, dynamicData, userValue, service) {
|
|
7798
|
-
var _a, _b
|
|
7801
|
+
var _a, _b;
|
|
7799
7802
|
if (compConfig == null ? void 0 : compConfig.headers) {
|
|
7800
7803
|
headers = {
|
|
7801
7804
|
headers: buildHeadersFormat(compConfig.headers)
|
|
7802
7805
|
};
|
|
7803
7806
|
}
|
|
7804
7807
|
if (compConfig.body) {
|
|
7805
|
-
body = { ...buildBodyFormat(compConfig.body, ((_b = (_a = store == null ? void 0 : store.ctx) == null ? void 0 : _a.core) == null ? void 0 : _b.data) || store.formData
|
|
7808
|
+
body = { ...buildBodyFormat(compConfig.body, store.newData || ((_b = (_a = store == null ? void 0 : store.ctx) == null ? void 0 : _a.core) == null ? void 0 : _b.data) || store.formData, userValue) };
|
|
7806
7809
|
}
|
|
7807
7810
|
if (compConfig.apiBody) {
|
|
7808
7811
|
const makeFunc = eval(compConfig.apiBody);
|