diff --git a/files/assets/js/core.js b/files/assets/js/core.js index d8a02edfb..b233bea46 100644 --- a/files/assets/js/core.js +++ b/files/assets/js/core.js @@ -327,6 +327,14 @@ function sendFormXHRSwitch(form) { ) } +function sendFormXHRReload(form) { + sendFormXHR(form, + () => { + location.reload(); + } + ) +} + let sortAscending = {}; function sort_table(t) { diff --git a/files/routes/posts.py b/files/routes/posts.py index 98c5851ce..65bee6eab 100644 --- a/files/routes/posts.py +++ b/files/routes/posts.py @@ -1089,5 +1089,4 @@ def edit_post(pid, v): ) g.db.add(ma) - - return redirect(p.permalink) + return {"message": "Post edited successfully!"} diff --git a/files/templates/post.html b/files/templates/post.html index 04dc0594d..4cb19e82f 100644 --- a/files/templates/post.html +++ b/files/templates/post.html @@ -157,7 +157,7 @@ {% if v and v.can_edit(p) and not v.is_suspended %}