mirror of
https://github.com/philomena-dev/philomena.git
synced 2024-11-23 20:18:00 +01:00
report for approval on edit as well
This commit is contained in:
parent
dce3ccb430
commit
59498f8d2a
2 changed files with 9 additions and 1 deletions
|
@ -112,6 +112,10 @@ defmodule PhilomenaWeb.Image.CommentController do
|
|||
def update(conn, %{"comment" => comment_params}) do
|
||||
case Comments.update_comment(conn.assigns.comment, conn.assigns.current_user, comment_params) do
|
||||
{:ok, %{comment: comment}} ->
|
||||
if not comment.approved do
|
||||
Comments.report_non_approved(comment)
|
||||
end
|
||||
|
||||
PhilomenaWeb.Endpoint.broadcast!(
|
||||
"firehose",
|
||||
"comment:update",
|
||||
|
|
|
@ -79,7 +79,11 @@ defmodule PhilomenaWeb.Topic.PostController do
|
|||
user = conn.assigns.current_user
|
||||
|
||||
case Posts.update_post(post, user, post_params) do
|
||||
{:ok, _post} ->
|
||||
{:ok, post} ->
|
||||
if not post.approved do
|
||||
Posts.report_non_approved(post)
|
||||
end
|
||||
|
||||
conn
|
||||
|> put_flash(:info, "Post successfully edited.")
|
||||
|> redirect(
|
||||
|
|
Loading…
Reference in a new issue