about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--uploader/templates/phenotypes/add-phenotypes-raw-files.html24
1 files changed, 22 insertions, 2 deletions
diff --git a/uploader/templates/phenotypes/add-phenotypes-raw-files.html b/uploader/templates/phenotypes/add-phenotypes-raw-files.html
index b799da7..b720792 100644
--- a/uploader/templates/phenotypes/add-phenotypes-raw-files.html
+++ b/uploader/templates/phenotypes/add-phenotypes-raw-files.html
@@ -578,8 +578,28 @@
   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 form = $("#frm-add-phenotypes");
+          if(form.length !== 1) {
+              // TODO: Handle error somehow?
+              alert("Could not find form!!!");
+              return false;
+          }
+
+          $.ajax({
+              "url": form.attr("action"),
+              "type": "POST",
+              "data": processForm(form[0]),
+              "processData": false,
+              "contentType": false,
+              "success": (data, textstatus, jqxhr) => {
+                  // TODO: Redirect to endpoint that should come as part of the
+                  //       success/error message.
+                  console.log("SUCCESS DATA: ", data);
+                  console.log("SUCCESS STATUS: ", textstatus);
+                  console.log("SUCCESS jqXHR: ", jqxhr);
+              },
+          });
+          return false;
       }
   };