mirror of
https://github.com/philomena-dev/philomena.git
synced 2024-11-27 05:37:59 +01:00
Fix resource name for fp ban controller
This commit is contained in:
parent
19eb5be999
commit
9f031725ac
2 changed files with 10 additions and 5 deletions
|
@ -7,7 +7,12 @@ defmodule PhilomenaWeb.Admin.FingerprintBanController do
|
|||
import Ecto.Query
|
||||
|
||||
plug :verify_authorized
|
||||
plug :load_resource, model: FingerprintBan, only: [:edit, :update, :delete]
|
||||
|
||||
plug :load_resource,
|
||||
model: FingerprintBan,
|
||||
as: :fingerprint_ban,
|
||||
only: [:edit, :update, :delete]
|
||||
|
||||
plug :check_can_delete when action in [:delete]
|
||||
|
||||
def index(conn, %{"q" => q}) when is_binary(q) do
|
||||
|
@ -56,12 +61,12 @@ defmodule PhilomenaWeb.Admin.FingerprintBanController do
|
|||
end
|
||||
|
||||
def edit(conn, _params) do
|
||||
changeset = Bans.change_fingerprint(conn.assigns.fingerprint)
|
||||
changeset = Bans.change_fingerprint(conn.assigns.fingerprint_ban)
|
||||
render(conn, "edit.html", title: "Editing Fingerprint Ban", changeset: changeset)
|
||||
end
|
||||
|
||||
def update(conn, %{"fingerprint" => fingerprint_ban_params}) do
|
||||
case Bans.update_fingerprint(conn.assigns.fingerprint, fingerprint_ban_params) do
|
||||
case Bans.update_fingerprint(conn.assigns.fingerprint_ban, fingerprint_ban_params) do
|
||||
{:ok, fingerprint_ban} ->
|
||||
conn
|
||||
|> put_flash(:info, "Fingerprint ban successfully updated.")
|
||||
|
@ -74,7 +79,7 @@ defmodule PhilomenaWeb.Admin.FingerprintBanController do
|
|||
end
|
||||
|
||||
def delete(conn, _params) do
|
||||
{:ok, fingerprint_ban} = Bans.delete_fingerprint(conn.assigns.fingerprint)
|
||||
{:ok, fingerprint_ban} = Bans.delete_fingerprint(conn.assigns.fingerprint_ban)
|
||||
|
||||
conn
|
||||
|> put_flash(:info, "Fingerprint ban successfully deleted.")
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
h1 Editing ban
|
||||
|
||||
= render PhilomenaWeb.Admin.FingerprintBanView, "_form.html", changeset: @changeset, action: ~p"/admin/fingerprint_bans/#{@fingerprint}", conn: @conn
|
||||
= render PhilomenaWeb.Admin.FingerprintBanView, "_form.html", changeset: @changeset, action: ~p"/admin/fingerprint_bans/#{@fingerprint_ban}", conn: @conn
|
||||
|
||||
br
|
||||
= link "Back", to: ~p"/admin/fingerprint_bans"
|
||||
|
|
Loading…
Reference in a new issue