mirror of
https://github.com/philomena-dev/philomena.git
synced 2025-07-29 00:50:44 +02:00
Log DNP entry transitions
This commit is contained in:
parent
8af67ab63a
commit
f68b94594f
1 changed files with 8 additions and 0 deletions
|
@ -16,6 +16,7 @@ defmodule PhilomenaWeb.Admin.DnpEntry.TransitionController do
|
|||
{:ok, dnp_entry} ->
|
||||
conn
|
||||
|> put_flash(:info, "Successfully updated DNP entry.")
|
||||
|> moderation_log(details: &log_details/2, data: dnp_entry)
|
||||
|> redirect(to: ~p"/dnp/#{dnp_entry}")
|
||||
|
||||
{:error, _changeset} ->
|
||||
|
@ -31,4 +32,11 @@ defmodule PhilomenaWeb.Admin.DnpEntry.TransitionController do
|
|||
_false -> PhilomenaWeb.NotAuthorizedPlug.call(conn)
|
||||
end
|
||||
end
|
||||
|
||||
defp log_details(_action, dnp_entry) do
|
||||
%{
|
||||
body: "#{String.capitalize(dnp_entry.aasm_state)} DNP entry #{dnp_entry.id}",
|
||||
subject_path: ~p"/dnp/#{dnp_entry}"
|
||||
}
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Reference in a new issue