From a59f002fb959745603ea65f490ccacb598013fc8 Mon Sep 17 00:00:00 2001 From: Frederick Muriuki Muriithi Date: Wed, 15 Jan 2025 17:01:25 -0600 Subject: Provide a means to submit the data. Currently, it's just a dummy function i.e. does not actually submit the data. --- uploader/templates/phenotypes/add-phenotypes-raw-files.html | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'uploader/templates') diff --git a/uploader/templates/phenotypes/add-phenotypes-raw-files.html b/uploader/templates/phenotypes/add-phenotypes-raw-files.html index 1af3dd0..8de67a0 100644 --- a/uploader/templates/phenotypes/add-phenotypes-raw-files.html +++ b/uploader/templates/phenotypes/add-phenotypes-raw-files.html @@ -564,14 +564,20 @@ }; }; + var uploaded_files = new Set(); + var submitForm = (new_file) => { + uploaded_files.add(new_file); + if(uploaded_files.size === resumables.length) { + //TODO: build up the new form from existing form and uploaded files + //TODO: submit the form to appropriate endpoint + } + }; var uploadSuccess = () => { return (file, message) => { console.log("THE FILE:", file); console.log("THE SUCCESS MESSAGE:", message); - // TODOS: - // * Save filename/filepath somewhere - // * Trigger some function that will run when all files have succeeded + submitForm(file.file.name); }; }; -- cgit v1.2.3