@visns-studio/visns-components 4.10.36 → 4.10.38

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
@@ -77,7 +77,7 @@
77
77
  "react-dom": "^17.0.0 || ^18.0.0"
78
78
  },
79
79
  "name": "@visns-studio/visns-components",
80
- "version": "4.10.36",
80
+ "version": "4.10.38",
81
81
  "description": "Various packages to assist in the development of our Custom Applications.",
82
82
  "main": "src/index.js",
83
83
  "files": [
@@ -258,8 +258,8 @@ function Field({
258
258
  filter.orderBy = s.orderBy;
259
259
  }
260
260
 
261
- if (a.where) {
262
- forEach(a.where, (w) => {
261
+ if (s.where) {
262
+ forEach(s.where, (w) => {
263
263
  filter.where.push(w);
264
264
  });
265
265
  }
@@ -677,7 +677,14 @@ function Form({
677
677
 
678
678
  if (!_.isEmpty(formData)) {
679
679
  Object.keys(formData).forEach((item) => {
680
- if (formData[item] instanceof File) {
680
+ const value = formData[item];
681
+
682
+ // Check if it's a single File or an array of File objects
683
+ if (
684
+ value instanceof File ||
685
+ (Array.isArray(value) &&
686
+ value.every((file) => file instanceof File))
687
+ ) {
681
688
  fileUpload = true;
682
689
  fileKey = item;
683
690
 
@@ -692,8 +699,9 @@ function Form({
692
699
  });
693
700
  }
694
701
 
695
- if (fileUpload && formData[fileKey]) {
696
- if (Array.isArray(formData[fileKey])) {
702
+ if (Array.isArray(formData[fileKey])) {
703
+ if (fileUpload && formData[fileKey]) {
704
+ console.info('File Upload:', formData[fileKey]);
697
705
  const uploadPromises = formData[fileKey].map(
698
706
  async (file) => {
699
707
  const toastId = toast.info(
@@ -787,6 +795,8 @@ function Form({
787
795
  return acc;
788
796
  }, {});
789
797
 
798
+ console.info('Payload:', payload);
799
+
790
800
  const res = await CustomFetch(url, method, payload);
791
801
 
792
802
  if (res.data.error === '') {