mirror of
https://github.com/philomena-dev/philomena.git
synced 2024-11-30 14:57:59 +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]
|
preload: [:user]
|
||||||
|
|
||||||
def create(conn, _params) do
|
def create(conn, _params) do
|
||||||
{:ok, user_link} =
|
{:ok, _} = UserLinks.contact_user_link(conn.assigns.user_link, conn.assigns.current_user)
|
||||||
UserLinks.contact_user_link(conn.assigns.user_link, conn.assigns.current_user)
|
|
||||||
|
|
||||||
conn
|
conn
|
||||||
|> put_flash(:info, "User link successfully marked as contacted.")
|
|> put_flash(:info, "User link successfully marked as contacted.")
|
||||||
|> redirect(
|
|> redirect(to: Routes.admin_user_link_path(conn, :index))
|
||||||
to: Routes.profile_user_link_path(conn, :show, conn.assigns.user_link.user, user_link)
|
|
||||||
)
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -13,12 +13,10 @@ defmodule PhilomenaWeb.Admin.UserLink.RejectController do
|
||||||
preload: [:user]
|
preload: [:user]
|
||||||
|
|
||||||
def create(conn, _params) do
|
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
|
conn
|
||||||
|> put_flash(:info, "User link successfully marked as rejected.")
|
|> put_flash(:info, "User link successfully marked as rejected.")
|
||||||
|> redirect(
|
|> redirect(to: Routes.admin_user_link_path(conn, :index))
|
||||||
to: Routes.profile_user_link_path(conn, :show, conn.assigns.user_link.user, user_link)
|
|
||||||
)
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -13,13 +13,10 @@ defmodule PhilomenaWeb.Admin.UserLink.VerificationController do
|
||||||
preload: [:user]
|
preload: [:user]
|
||||||
|
|
||||||
def create(conn, _params) do
|
def create(conn, _params) do
|
||||||
{:ok, %{user_link: user_link}} =
|
{:ok, _} = UserLinks.verify_user_link(conn.assigns.user_link, conn.assigns.current_user)
|
||||||
UserLinks.verify_user_link(conn.assigns.user_link, conn.assigns.current_user)
|
|
||||||
|
|
||||||
conn
|
conn
|
||||||
|> put_flash(:info, "User link successfully verified.")
|
|> put_flash(:info, "User link successfully verified.")
|
||||||
|> redirect(
|
|> redirect(to: Routes.admin_user_link_path(conn, :index))
|
||||||
to: Routes.profile_user_link_path(conn, :show, conn.assigns.user_link.user, user_link)
|
|
||||||
)
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue