diff --git a/ui/src/pages/common.js b/ui/src/pages/common.js index b238c2e25..cd95e3b37 100644 --- a/ui/src/pages/common.js +++ b/ui/src/pages/common.js @@ -306,7 +306,7 @@ function set_page_warning(msg) { $('#page_warning').text(msg); } -function api_error(propagate_api_error){ +function api_error(propagate_api_error) { if (propagate_api_error) { if(jqXHR.responseJSON && jqXHR.status == 400) { propagate_form_api_errors(jqXHR.responseJSON.data); @@ -400,19 +400,19 @@ function post_request_api(uri, data, propagate_api_error, beforeSend_fn, cid, on }); } -function post_request_data_api(uri, data, propagate_api_error, beforeSend_fn) { +function post_request_data_api(uri, data, beforeSend_fn) { return $.ajax({ url: uri + case_param(), type: 'POST', data: data, - dataType: "json", + dataType: 'json', contentType: false, processData: false, beforeSend: function(jqXHR, settings) { sendBefore(beforeSend_fn, settings); }, error: function(jqXHR) { - api_error(propagate_api_error); + api_error(true); } }); } diff --git a/ui/src/pages/datastore.js b/ui/src/pages/datastore.js index 0a1653cf6..167684bf0 100644 --- a/ui/src/pages/datastore.js +++ b/ui/src/pages/datastore.js @@ -290,7 +290,7 @@ async function save_ds_multi_files(node, index_i) { let file = $('#input_upload_ds_files').prop('files')[index]; formData.append('file_content', file); formData.append('file_original_name', file.name); - await post_request_data_api(`/datastore/file/add/${node}`, formData, true, function () { + await post_request_data_api(`/datastore/file/add/${node}`, formData, function () { window.swal({ title: `File ${file.name} is uploading. (${index}/${totalFiles} files)`, text: "Please wait. This window will close automatically when the file is uploaded.", @@ -319,7 +319,7 @@ function save_ds_file(node, file_id) { uri = `/datastore/file/update/${file_id}`; } - post_request_data_api(uri, formData, true, function() { + post_request_data_api(uri, formData, function() { window.swal({ title: "File is uploading", text: "Please wait. This window will close automatically when the file is uploaded.",