mirror of
https://github.com/philomena-dev/philomena.git
synced 2024-11-24 04:27:59 +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
|
def update(conn, %{"comment" => comment_params}) do
|
||||||
case Comments.update_comment(conn.assigns.comment, conn.assigns.current_user, comment_params) do
|
case Comments.update_comment(conn.assigns.comment, conn.assigns.current_user, comment_params) do
|
||||||
{:ok, %{comment: comment}} ->
|
{:ok, %{comment: comment}} ->
|
||||||
|
if not comment.approved do
|
||||||
|
Comments.report_non_approved(comment)
|
||||||
|
end
|
||||||
|
|
||||||
PhilomenaWeb.Endpoint.broadcast!(
|
PhilomenaWeb.Endpoint.broadcast!(
|
||||||
"firehose",
|
"firehose",
|
||||||
"comment:update",
|
"comment:update",
|
||||||
|
|
|
@ -79,7 +79,11 @@ defmodule PhilomenaWeb.Topic.PostController do
|
||||||
user = conn.assigns.current_user
|
user = conn.assigns.current_user
|
||||||
|
|
||||||
case Posts.update_post(post, user, post_params) do
|
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
|
conn
|
||||||
|> put_flash(:info, "Post successfully edited.")
|
|> put_flash(:info, "Post successfully edited.")
|
||||||
|> redirect(
|
|> redirect(
|
||||||
|
|
Loading…
Reference in a new issue