fix csv file upload bug

This commit is contained in:
anovazzi1 2023-08-01 18:53:47 -03:00
commit 1d20a91b6e
4 changed files with 10 additions and 6 deletions

View file

@ -432,8 +432,12 @@ export default function CodeTabsComponent({
.suffixes .suffixes
} }
onFileChange={( onFileChange={(
k: any value: any
) => {}} ) => {
t.data.node.template[
n
].file_path = value;
}}
></InputFileComponent> ></InputFileComponent>
</div> </div>
</ShadTooltip> </ShadTooltip>

View file

@ -66,12 +66,12 @@ export default function InputFileComponent({
const { file_path } = data; const { file_path } = data;
console.log("File name:", file_path); console.log("File name:", file_path);
// sets the value that goes to the backend
onFileChange(file_path);
// Update the state and callback with the name of the file // Update the state and callback with the name of the file
// sets the value to the user // sets the value to the user
setMyValue(file.name); setMyValue(file.name);
onChange(file.name); onChange(file.name);
// sets the value that goes to the backend
onFileChange(file_path);
setLoading(false); setLoading(false);
}) })
.catch(() => { .catch(() => {

View file

@ -238,7 +238,7 @@ const EditNodeModal = forwardRef(
} }
suffixes={myData.node.template[n].suffixes} suffixes={myData.node.template[n].suffixes}
onFileChange={(t: string) => { onFileChange={(t: string) => {
handleOnNewValue(t, n); data.node.template[n].file_path = t;
}} }}
></InputFileComponent> ></InputFileComponent>
</div> </div>

View file

@ -142,7 +142,7 @@ export default function ModalField({
fileTypes={data.node.template[name].fileTypes} fileTypes={data.node.template[name].fileTypes}
suffixes={data.node.template[name].suffixes} suffixes={data.node.template[name].suffixes}
onFileChange={(t: string) => { onFileChange={(t: string) => {
data.node.template[name].content = t; data.node.template[name].file_path = t;
}} }}
></InputFileComponent> ></InputFileComponent>
</div> </div>