From 1d25a952fac545c5814a3ab9bac087f572248588 Mon Sep 17 00:00:00 2001 From: Frederick Muriuki Muriithi Date: Tue, 21 Jan 2025 10:38:10 -0600 Subject: Track what file is uploaded Provide the related file input's name together with the success message in order to track which uploaded file is related to each of the different file types. --- uploader/templates/phenotypes/add-phenotypes-raw-files.html | 8 +++----- 1 file changed, 3 insertions(+), 5 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 8de67a0..9eef50d 100644 --- a/uploader/templates/phenotypes/add-phenotypes-raw-files.html +++ b/uploader/templates/phenotypes/add-phenotypes-raw-files.html @@ -573,11 +573,9 @@ } }; - var uploadSuccess = () => { + var uploadSuccess = (file_input_name) => { return (file, message) => { - console.log("THE FILE:", file); - console.log("THE SUCCESS MESSAGE:", message); - submitForm(file.file.name); + submitForm({...JSON.parse(message), "file-input-name": file_input_name}); }; }; @@ -628,7 +626,7 @@ startUpload($("#" + resumable_element_id + "-browse-button"), $("#" + resumable_element_id + "-retry-button"), $("#" + resumable_element_id + "-cancel-button"))), - uploadSuccess()), + uploadSuccess(file_input.attr("name"))), uploadError()); /** Setup progress indicator **/ -- cgit v1.2.3