Skip to content

Commit

Permalink
send post data in payload per @mvdbeek suggestion
Browse files Browse the repository at this point in the history
  • Loading branch information
martenson committed Feb 28, 2019
1 parent 4dae35e commit 2039376
Showing 1 changed file with 29 additions and 24 deletions.
53 changes: 29 additions & 24 deletions client/galaxy/scripts/mvc/library/library-foldertoolbar-view.js
Expand Up @@ -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");
Expand All @@ -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();
Expand Down Expand Up @@ -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.");
Expand All @@ -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();
Expand Down

0 comments on commit 2039376

Please sign in to comment.