Skip to content

Commit

Permalink
Redirect to homepage on sole entry deletion in admin UI.
Browse files Browse the repository at this point in the history
  • Loading branch information
knadh committed Jun 27, 2022
1 parent 0e43442 commit 0bc69de
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion admin/static/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,15 @@ function searchResultsComponent(typ) {
if (!confirm("Delete this entry? The definitions are not deleted and may be attached to other entries.")) {
return;
}
this.api('entries.delete', `/entries/${id}`, 'DELETE').then(() => this.refresh());
this.api('entries.delete', `/entries/${id}`, 'DELETE').then(() => {
if (this.id) {
// Individual entry view and it's now deleted. Redirect to the homepage.
document.location.href = _urls.admin;
return;
}

this.refresh()
});
},

onApproveSubmission(id) {
Expand Down

0 comments on commit 0bc69de

Please sign in to comment.