Allow project undeletion, fixes T51244

Projects can be undeleted within a month of deletion.
This commit is contained in:
2017-12-22 16:27:05 +01:00
parent 46612a9f68
commit 8f73dab36e
5 changed files with 132 additions and 16 deletions

View File

@@ -182,11 +182,13 @@ $( document ).ready(function() {
$('#item_delete').click(function(e){
e.preventDefault();
if (ProjectUtils.isProject()) {
$.post(urlProjectDelete, {project_id: ProjectUtils.projectId()},
function (data) {
// Feedback logic
}).done(function () {
window.location.replace('/p/');
$.post(urlProjectDelete, {project_id: ProjectUtils.projectId()})
.done(function () {
// Redirect to the /p/ URL that shows deleted projects.
window.location.replace('/p/?deleted=1');
})
.fail(function(err) {
toastr.error(xhrErrorResponseMessage(err), 'Project deletion failed');
});
} else {
$.post(urlNodeDelete, {node_id: ProjectUtils.nodeId()},