Unify deletion routes. Closes #1332.

This commit is contained in:
Bart Kamphorst
2018-10-17 22:18:23 +02:00
parent 6475394133
commit 454b5e94dc
5 changed files with 26 additions and 32 deletions
@@ -47,8 +47,12 @@ $(document).ready(function() {
$('#delete-link').click( function(e) {
var ok = confirm($(this).data('confirm'));
if ( ok ) {
var loc = '<%= delete_path %>/' + pageFullPath;
window.location = loc;
$.post('<%=delete_path %>/' + pageFullPath,
{},
function (result) {
// page successfully deleted, return to landing page
window.location = '/';
});
}
// Don't navigate on cancel.
e.preventDefault();