Skip to content
Snippets Groups Projects
Commit 58845c1a authored by juanf's avatar juanf
Browse files

SSDM-4727 : Fix to avoid V3 API Bug until is fixed.

SVN: 37658
parent d119f0a7
No related branches found
No related tags found
No related merge requests found
...@@ -81,23 +81,33 @@ function SampleTableController(parentController, title, experimentIdentifier, pr ...@@ -81,23 +81,33 @@ function SampleTableController(parentController, title, experimentIdentifier, pr
Util.showError("Please select at least one sample to delete!"); Util.showError("Please select at least one sample to delete!");
} else { } else {
var warningText = "The next " + ELNDictionary.samples + " will be deleted: "; var warningText = "The next " + ELNDictionary.samples + " will be deleted: ";
var sampleTechIds = [];
var sampleIdentifiers = [];
for(var sIdx = 0; sIdx < selected.length; sIdx++) { for(var sIdx = 0; sIdx < selected.length; sIdx++) {
sampleTechIds.push(selected[sIdx].id); sampleIdentifiers.push(selected[sIdx].identifier);
warningText += selected[sIdx].identifier + " ";
} }
var modalView = new DeleteEntityController(function(reason) { Util.blockUI();
mainController.serverFacade.deleteSamples(sampleTechIds, reason, function(data) { mainController.serverFacade.searchWithIdentifiers(sampleIdentifiers, function(selectedFinal) {
if(data.error) { var sampleTechIds = [];
Util.showError(data.error.message); for(var sIdx = 0; sIdx < selectedFinal.length; sIdx++) {
} else { sampleTechIds.push(selectedFinal[sIdx].id);
Util.showSuccess("" + ELNDictionary.Sample + "/s Deleted"); warningText += selectedFinal[sIdx].identifier + " ";
mainController.refreshView(); }
} var modalView = new DeleteEntityController(function(reason) {
}); mainController.serverFacade.deleteSamples(sampleTechIds, reason, function(data) {
}, true, warningText); if(data.error) {
modalView.init(); Util.showError(data.error.message);
} else {
Util.showSuccess("" + ELNDictionary.Sample + "/s Deleted");
mainController.refreshView();
}
});
}, true, warningText);
modalView.init();
});
} }
}}); }});
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment