mirror of
https://github.com/philomena-dev/philomena.git
synced 2024-11-23 20:18:00 +01:00
redirect to admin path when transitioning user link
This commit is contained in:
parent
de8622b470
commit
76a1cf8b3a
3 changed files with 6 additions and 14 deletions
|
@ -13,13 +13,10 @@ defmodule PhilomenaWeb.Admin.UserLink.ContactController do
|
|||
preload: [:user]
|
||||
|
||||
def create(conn, _params) do
|
||||
{:ok, user_link} =
|
||||
UserLinks.contact_user_link(conn.assigns.user_link, conn.assigns.current_user)
|
||||
{:ok, _} = UserLinks.contact_user_link(conn.assigns.user_link, conn.assigns.current_user)
|
||||
|
||||
conn
|
||||
|> put_flash(:info, "User link successfully marked as contacted.")
|
||||
|> redirect(
|
||||
to: Routes.profile_user_link_path(conn, :show, conn.assigns.user_link.user, user_link)
|
||||
)
|
||||
|> redirect(to: Routes.admin_user_link_path(conn, :index))
|
||||
end
|
||||
end
|
||||
|
|
|
@ -13,12 +13,10 @@ defmodule PhilomenaWeb.Admin.UserLink.RejectController do
|
|||
preload: [:user]
|
||||
|
||||
def create(conn, _params) do
|
||||
{:ok, user_link} = UserLinks.reject_user_link(conn.assigns.user_link)
|
||||
{:ok, _} = UserLinks.reject_user_link(conn.assigns.user_link)
|
||||
|
||||
conn
|
||||
|> put_flash(:info, "User link successfully marked as rejected.")
|
||||
|> redirect(
|
||||
to: Routes.profile_user_link_path(conn, :show, conn.assigns.user_link.user, user_link)
|
||||
)
|
||||
|> redirect(to: Routes.admin_user_link_path(conn, :index))
|
||||
end
|
||||
end
|
||||
|
|
|
@ -13,13 +13,10 @@ defmodule PhilomenaWeb.Admin.UserLink.VerificationController do
|
|||
preload: [:user]
|
||||
|
||||
def create(conn, _params) do
|
||||
{:ok, %{user_link: user_link}} =
|
||||
UserLinks.verify_user_link(conn.assigns.user_link, conn.assigns.current_user)
|
||||
{:ok, _} = UserLinks.verify_user_link(conn.assigns.user_link, conn.assigns.current_user)
|
||||
|
||||
conn
|
||||
|> put_flash(:info, "User link successfully verified.")
|
||||
|> redirect(
|
||||
to: Routes.profile_user_link_path(conn, :show, conn.assigns.user_link.user, user_link)
|
||||
)
|
||||
|> redirect(to: Routes.admin_user_link_path(conn, :index))
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue