From 2039376ddf21abb8e56b4ec984ea9d7fed46efb8 Mon Sep 17 00:00:00 2001 From: Martin Cech Date: Thu, 28 Feb 2019 14:20:36 -0500 Subject: [PATCH] send post data in payload per @mvdbeek suggestion --- .../mvc/library/library-foldertoolbar-view.js | 53 ++++++++++--------- 1 file changed, 29 insertions(+), 24 deletions(-) diff --git a/client/galaxy/scripts/mvc/library/library-foldertoolbar-view.js b/client/galaxy/scripts/mvc/library/library-foldertoolbar-view.js index b0fbc9a2335..73c60c3a59b 100644 --- a/client/galaxy/scripts/mvc/library/library-foldertoolbar-view.js +++ b/client/galaxy/scripts/mvc/library/library-foldertoolbar-view.js @@ -878,7 +878,7 @@ var FolderToolbarView = Backbone.View.extend({ */ chainCallImportingUserdirFiles: function(options) { let Galaxy = getGalaxyInstance(); - var popped_item = options.paths.pop(); + let popped_item = options.paths.pop(); if (typeof popped_item === "undefined") { if (this.options.chain_call_control.failed_number === 0) { mod_toastr.success("Selected files imported into the current folder"); @@ -888,17 +888,19 @@ var FolderToolbarView = Backbone.View.extend({ } return true; } - var promise = $.when( - $.post( - `${getAppRoot()}api/libraries/datasets?encoded_folder_id=${this.id}&source=${ - options.source - }&path=${popped_item}&file_type=${options.file_type}&link_data=${options.link_data}&space_to_tab=${ - options.space_to_tab - }&to_posix_lines=${options.to_posix_lines}&dbkey=${options.dbkey}&tag_using_filenames=${ - options.tag_using_filenames - }` - ) - ); + let post_url = `${getAppRoot()}api/libraries/datasets`; + let post_data = { + encoded_folder_id: this.id, + source: options.source, + path: popped_item, + file_type: options.file_type, + link_data: options.link_data, + space_to_tab: options.space_to_tab, + to_posix_lines: options.to_posix_lines, + dbkey: options.dbkey, + tag_using_filenames: options.tag_using_filenames + }; + let promise = $.when($.post(post_url, post_data)); promise .done(response => { this.updateProgress(); @@ -926,7 +928,7 @@ var FolderToolbarView = Backbone.View.extend({ chainCallImportingFolders: function(options) { let Galaxy = getGalaxyInstance(); // TODO need to check which paths to call - var popped_item = options.paths.pop(); + let popped_item = options.paths.pop(); if (typeof popped_item == "undefined") { if (this.options.chain_call_control.failed_number === 0) { mod_toastr.success("Selected folders and their contents imported into the current folder."); @@ -937,17 +939,20 @@ var FolderToolbarView = Backbone.View.extend({ } return true; } - var promise = $.when( - $.post( - `${getAppRoot()}api/libraries/datasets?encoded_folder_id=${this.id}&source=${ - options.source - }&path=${popped_item}&preserve_dirs=${options.preserve_dirs}&link_data=${ - options.link_data - }&to_posix_lines=${options.to_posix_lines}&space_to_tab=${options.space_to_tab}&file_type=${ - options.file_type - }&dbkey=${options.dbkey}&tag_using_filenames=${options.tag_using_filenames}` - ) - ); + let post_url = `${getAppRoot()}api/libraries/datasets`; + let post_data = { + encoded_folder_id: this.id, + source: options.source, + path: popped_item, + preserve_dirs: options.preserve_dirs, + link_data: options.link_data, + to_posix_lines: options.to_posix_lines, + space_to_tab: options.space_to_tab, + file_type: options.file_type, + dbkey: options.dbkey, + tag_using_filenames: options.tag_using_filenames + }; + let promise = $.when($.post(post_url, post_data)); promise .done(response => { this.updateProgress();