@visns-studio/visns-components 4.10.37 → 4.10.39

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.37",
80
+ "version": "4.10.39",
81
81
  "description": "Various packages to assist in the development of our Custom Applications.",
82
82
  "main": "src/index.js",
83
83
  "files": [
@@ -580,6 +580,8 @@ const DataGrid = forwardRef(
580
580
  }
581
581
  });
582
582
 
583
+ console.info(fsd);
584
+
583
585
  setFormSettingData(fsd);
584
586
  }
585
587
  }
@@ -574,10 +574,6 @@ function Form({
574
574
  }
575
575
  };
576
576
 
577
- useEffect(() => {
578
- console.info('Form Settings', formSettings);
579
- }, [formSettings]);
580
-
581
577
  const handleSubmit = async (e) => {
582
578
  try {
583
579
  if (e) {
@@ -677,7 +673,14 @@ function Form({
677
673
 
678
674
  if (!_.isEmpty(formData)) {
679
675
  Object.keys(formData).forEach((item) => {
680
- if (formData[item] instanceof File) {
676
+ const value = formData[item];
677
+
678
+ // Check if it's a single File or an array of File objects
679
+ if (
680
+ value instanceof File ||
681
+ (Array.isArray(value) &&
682
+ value.every((file) => file instanceof File))
683
+ ) {
681
684
  fileUpload = true;
682
685
  fileKey = item;
683
686
 
@@ -692,8 +695,8 @@ function Form({
692
695
  });
693
696
  }
694
697
 
695
- if (fileUpload && formData[fileKey]) {
696
- if (Array.isArray(formData[fileKey])) {
698
+ if (Array.isArray(formData[fileKey])) {
699
+ if (fileUpload && formData[fileKey]) {
697
700
  const uploadPromises = formData[fileKey].map(
698
701
  async (file) => {
699
702
  const toastId = toast.info(
@@ -787,6 +790,8 @@ function Form({
787
790
  return acc;
788
791
  }, {});
789
792
 
793
+ console.info('Payload:', payload);
794
+
790
795
  const res = await CustomFetch(url, method, payload);
791
796
 
792
797
  if (res.data.error === '') {