public/javascripts/datasetListProcess.js
//Method to detach all files from first, and then remove the dataset and redirect back to a specific URL on completion
Method to detach all files from first, and then remove the dataset and redirect back to a specific URL on completion
Method to detach all files from first and then remove the dataset and redirect back to a specific URL on completion
function detachAndRemoveDatasetAndRedirect(datasetId, url){
	if(url === undefined) reloadPage = "/datasets";
	var request = jsRoutes.api.Datasets.detachAndDeleteDataset(datasetId).ajax({
		type: 'POST'
	});
	request.done(function (response, textStatus, jqXHR){
		console.log("Response " + response);		
		window.location.href=url;
	});
	request.fail(function (jqXHR, textStatus, errorThrown){
        console.error("The following error occurred: " + textStatus, errorThrown);
        var errMsg = "You must be logged in to detach files and then delete a dataset from the system.";        
        if (!checkErrorAndRedirect(jqXHR, errMsg)) {
            notify("The dataset was not deleted from the system due to : " + errorThrown, "error");
        }
	});	
}
function detachAndRemoveDatasetAndRedirect ( datasetId , url ) { if ( url === undefined ) reloadPage = "/datasets" ; var request = jsRoutes . api . Datasets . detachAndDeleteDataset ( datasetId ) . ajax ( { type : 'POST' } ) ; request . done ( function ( response , textStatus , jqXHR ) { console . log ( "Response " + response ) ; window . location . href = url ; } ) ; request . fail ( function ( jqXHR , textStatus , errorThrown ) { console . error ( "The following error occurred: " + textStatus , errorThrown ) ; var errMsg = "You must be logged in to detach files and then delete a dataset from the system." ; if ( ! checkErrorAndRedirect ( jqXHR , errMsg ) ) { notify ( "The dataset was not deleted from the system due to : " + errorThrown , "error" ) ; } } ) ; }
Method to detach all files from first, and then remove the dataset and redirect back to a specific URL on completion
Method to detach all files from first and then remove the dataset and redirect back to a specific URL on completion