@visns-studio/visns-components 5.10.1 → 5.10.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 +1 -1
- package/src/components/crm/Field.jsx +17 -3
package/package.json
CHANGED
|
@@ -87,7 +87,7 @@
|
|
|
87
87
|
"react-dom": "^17.0.0 || ^18.0.0"
|
|
88
88
|
},
|
|
89
89
|
"name": "@visns-studio/visns-components",
|
|
90
|
-
"version": "5.10.
|
|
90
|
+
"version": "5.10.2",
|
|
91
91
|
"description": "Various packages to assist in the development of our Custom Applications.",
|
|
92
92
|
"main": "src/index.js",
|
|
93
93
|
"files": [
|
|
@@ -162,8 +162,18 @@ function Field({
|
|
|
162
162
|
let filter = {};
|
|
163
163
|
|
|
164
164
|
if (settings.where?.length > 0) {
|
|
165
|
+
const processedWhere = settings.where.map((whereItem) => {
|
|
166
|
+
if (whereItem.getKey && formData[whereItem.getKey]) {
|
|
167
|
+
return {
|
|
168
|
+
...whereItem,
|
|
169
|
+
value: formData[whereItem.getKey],
|
|
170
|
+
};
|
|
171
|
+
}
|
|
172
|
+
return whereItem;
|
|
173
|
+
});
|
|
174
|
+
|
|
165
175
|
filter = {
|
|
166
|
-
where:
|
|
176
|
+
where: processedWhere,
|
|
167
177
|
};
|
|
168
178
|
}
|
|
169
179
|
|
|
@@ -187,6 +197,8 @@ function Field({
|
|
|
187
197
|
};
|
|
188
198
|
}
|
|
189
199
|
|
|
200
|
+
console.info(JSON.stringify(filter));
|
|
201
|
+
|
|
190
202
|
CustomFetch(settings.url, 'POST', filter, function (result) {
|
|
191
203
|
setOptions(result.data);
|
|
192
204
|
|
|
@@ -247,7 +259,7 @@ function Field({
|
|
|
247
259
|
);
|
|
248
260
|
setCanvasUrl(canvasType.url);
|
|
249
261
|
}
|
|
250
|
-
}, [settings, counter]);
|
|
262
|
+
}, [settings, counter, formData]);
|
|
251
263
|
|
|
252
264
|
const fetchChildDropdownData = (s, v) => {
|
|
253
265
|
let filter = {};
|
|
@@ -265,7 +277,9 @@ function Field({
|
|
|
265
277
|
{
|
|
266
278
|
id: s.id,
|
|
267
279
|
value: _inputValue,
|
|
268
|
-
...(a.whereHas && {
|
|
280
|
+
...(a.whereHas && {
|
|
281
|
+
whereHas: a.whereHas,
|
|
282
|
+
}),
|
|
269
283
|
},
|
|
270
284
|
],
|
|
271
285
|
};
|