@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.
|
|
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": [
|
|
@@ -677,7 +677,14 @@ function Form({
|
|
|
677
677
|
|
|
678
678
|
if (!_.isEmpty(formData)) {
|
|
679
679
|
Object.keys(formData).forEach((item) => {
|
|
680
|
-
|
|
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 (
|
|
696
|
-
if (
|
|
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 === '') {
|