2019-11-29 14:29:01 -05:00
|
|
|
defmodule PhilomenaWeb.Topic.ReadController do
|
|
|
|
import Plug.Conn
|
|
|
|
use PhilomenaWeb, :controller
|
|
|
|
|
|
|
|
alias Philomena.Forums.Forum
|
|
|
|
alias Philomena.Topics
|
|
|
|
|
2020-03-03 13:54:47 -05:00
|
|
|
plug :load_resource,
|
2020-01-10 23:20:19 -05:00
|
|
|
model: Forum,
|
|
|
|
id_name: "forum_id",
|
|
|
|
id_field: "short_name",
|
|
|
|
persisted: true
|
2019-11-29 14:29:01 -05:00
|
|
|
|
2019-12-14 14:46:50 -05:00
|
|
|
plug PhilomenaWeb.LoadTopicPlug, show_hidden: true
|
|
|
|
|
|
|
|
def create(conn, _params) do
|
2019-11-29 14:29:01 -05:00
|
|
|
user = conn.assigns.current_user
|
|
|
|
|
2024-07-07 18:09:20 -04:00
|
|
|
Topics.clear_topic_notification(conn.assigns.topic, user)
|
2019-11-29 14:29:01 -05:00
|
|
|
|
|
|
|
send_resp(conn, :ok, "")
|
|
|
|
end
|
2019-12-14 14:46:50 -05:00
|
|
|
end
|