impaktapps-ui-builder 1.0.59-flcikering.0.1 → 1.0.59-flcikering.0.2
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
|
@@ -179,14 +179,29 @@ function mergeFormdata(handlerResponse: any, componentName: string, eventConfig:
|
|
|
179
179
|
}
|
|
180
180
|
else if (eventConfig.type === "page") {
|
|
181
181
|
if (!(_.isEmpty(handlerResponse?.data) && handlerResponse?.data)) {
|
|
182
|
+
// store.newData = {
|
|
183
|
+
// ...store.newData,
|
|
184
|
+
// ...handlerResponse?.data
|
|
185
|
+
// }
|
|
186
|
+
// store.setFormdata((pre: any) => { return { ...pre, ...handlerResponse?.data } })
|
|
187
|
+
const clonedData = _.cloneDeep(handlerResponse.data);
|
|
188
|
+
|
|
189
|
+
// ✅ Update store.newData immutably
|
|
182
190
|
store.newData = {
|
|
183
191
|
...store.newData,
|
|
184
|
-
...
|
|
185
|
-
}
|
|
186
|
-
|
|
192
|
+
...clonedData,
|
|
193
|
+
};
|
|
194
|
+
|
|
195
|
+
// ✅ Update formData immutably with cloned data
|
|
196
|
+
store.setFormdata((prev: any) => ({
|
|
197
|
+
...prev,
|
|
198
|
+
...clonedData,
|
|
199
|
+
}));
|
|
187
200
|
}
|
|
188
201
|
}
|
|
189
202
|
else if (eventConfig.type === "Table" && eventConfig.lazyLoading) {
|
|
203
|
+
|
|
204
|
+
console.log("eventConfig.type === Table >>", handlerResponse );
|
|
190
205
|
if (handlerResponse && handlerResponse?.data) {
|
|
191
206
|
const tableData = Array.isArray(handlerResponse.data?.data)
|
|
192
207
|
? cloneDeep(handlerResponse.data.data)
|
|
@@ -210,8 +225,17 @@ function mergeFormdata(handlerResponse: any, componentName: string, eventConfig:
|
|
|
210
225
|
}
|
|
211
226
|
else {
|
|
212
227
|
if (handlerResponse) {
|
|
213
|
-
formDataHolder[componentName] = handlerResponse.data
|
|
214
|
-
store.setFormdata((pre) => { return { ...pre, ...formDataHolder } });
|
|
228
|
+
// formDataHolder[componentName] = handlerResponse.data
|
|
229
|
+
// store.setFormdata((pre) => { return { ...pre, ...formDataHolder } });
|
|
230
|
+
|
|
231
|
+
console.log("else part >>", handlerResponse);
|
|
232
|
+
const clonedData = _.cloneDeep(handlerResponse.data);
|
|
233
|
+
const newFormDataHolder = {
|
|
234
|
+
...formDataHolder,
|
|
235
|
+
[componentName]: clonedData,
|
|
236
|
+
};
|
|
237
|
+
|
|
238
|
+
store.setFormdata((prev) => ({ ...prev, ...newFormDataHolder }));
|
|
215
239
|
}
|
|
216
240
|
}
|
|
217
241
|
}
|