public/javascripts/datasetListProcess.js
//Method to remove the dataset and redirect back to a specific URL on completion
Method to remove the dataset and redirect back to a specific URL on completion
Method to remove the dataset and redirect back to a specific URL on completion
function removeDatasetAndRedirect(datasetId, url){
	if(url === undefined) reloadPage = "/datasets";
	var request = jsRoutes.api.Datasets.deleteDataset(datasetId).ajax({
		type: 'DELETE'
	});
	request.done(function (response, textStatus, jqXHR){		
		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 delete a dataset from the system.";        
        if (!checkErrorAndRedirect(jqXHR, errMsg)) {
            notify("The dataset was not deleted from the system due to : " + errorThrown, "error");
        }
	});	
}
function removeDatasetAndRedirect ( datasetId , url ) { if ( url === undefined ) reloadPage = "/datasets" ; var request = jsRoutes . api . Datasets . deleteDataset ( datasetId ) . ajax ( { type : 'DELETE' } ) ; request . done ( function ( response , textStatus , jqXHR ) { 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 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 remove the dataset and redirect back to a specific URL on completion
Method to remove the dataset and redirect back to a specific URL on completion