diff options
author | Matt Strapp <matt@mattstrapp.net> | 2022-04-05 17:57:54 +0200 |
---|---|---|
committer | Matt Strapp <matt@mattstrapp.net> | 2022-04-05 17:57:55 +0200 |
commit | 73892092f9af26658d16f5cb9c5b79b5aed2b348 (patch) | |
tree | 1b8431f0184c853a490bab93303659f29923f9e6 /src | |
parent | Bump @typescript-eslint/eslint-plugin from 5.17.0 to 5.18.0 (#40) (diff) | |
download | ee4511w-web-73892092f9af26658d16f5cb9c5b79b5aed2b348.tar ee4511w-web-73892092f9af26658d16f5cb9c5b79b5aed2b348.tar.gz ee4511w-web-73892092f9af26658d16f5cb9c5b79b5aed2b348.tar.bz2 ee4511w-web-73892092f9af26658d16f5cb9c5b79b5aed2b348.tar.lz ee4511w-web-73892092f9af26658d16f5cb9c5b79b5aed2b348.tar.xz ee4511w-web-73892092f9af26658d16f5cb9c5b79b5aed2b348.tar.zst ee4511w-web-73892092f9af26658d16f5cb9c5b79b5aed2b348.zip |
Fix problem with form pointing to the wrong endpoint
Signed-off-by: Matt Strapp <matt@mattstrapp.net>
Diffstat (limited to '')
-rw-r--r-- | src/public/js/form.js | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/src/public/js/form.js b/src/public/js/form.js index 9823dcf..1e9eaca 100644 --- a/src/public/js/form.js +++ b/src/public/js/form.js @@ -15,7 +15,7 @@ document.getElementById('upload').onsubmit = function () { document.getElementById('download-link').innerText = ''; // Make AJAX request let xhr = new XMLHttpRequest(); - xhr.open('POST', '/api/v1/pendulum/upload'); + xhr.open('POST', '/api/v1/upload'); let formData = new FormData(this); xhr.send(formData); xhr.onreadystatechange = function () { @@ -43,7 +43,7 @@ document.getElementById('upload').onsubmit = function () { // function actuate(file) { let xhr = new XMLHttpRequest(); - xhr.open('POST', '/api/v1/pendulum/actuate'); + xhr.open('POST', '/api/v1/actuate'); let data = { file: file.file, }; @@ -72,10 +72,7 @@ function createDownload(response) { const tempName = response.filename; const downloadName = response.name.split('.')[0]; const downloadLink = document.createElement('a'); - downloadLink.setAttribute( - 'href', - `/api/v1/pendulum/download/?filename=${tempName}` - ); + downloadLink.setAttribute('href', `/api/v1/download/?filename=${tempName}`); downloadLink.setAttribute('download', `${downloadName}.csv`); downloadLink.innerText = 'Download CSV of results here.'; document.getElementById('download-link').appendChild(downloadLink); |