From 357537b6d2b3ab674276e919aba1e931d010d68f Mon Sep 17 00:00:00 2001 From: Martin Quarda Date: Mon, 7 Oct 2024 07:49:12 +0200 Subject: [PATCH] hopefully last fix --- frontend/src/scripts/index.js | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/frontend/src/scripts/index.js b/frontend/src/scripts/index.js index 11b6837..801f302 100644 --- a/frontend/src/scripts/index.js +++ b/frontend/src/scripts/index.js @@ -63,10 +63,11 @@ class Main extends Component { let form = document.getElementById("form"); let api_endpoint = form.action; let formData = new FormData(form); - console.log(this.state.files) - this.state.files.forEach((file, _)=>{ - formData.append(file.name, file); - }) + if (this.state.files && api_endpoint == "/api/upload_files"){ + this.state.files.forEach((file, _)=>{ + formData.append(file.name, file); + }) + } fetch(addr_prefix + api_endpoint, { method:"POST", body: formData, @@ -153,7 +154,7 @@ class Main extends Component { {this.state.page == "#upload_files" &&
this.onSubmit(e)}> - +
} @@ -276,7 +277,7 @@ class Main extends Component {

Sportem ku chlastu!

-

Výsledky 1. ročníku

+

Výsledky 1. ročníku

{this.state.results &&