I’m trying to add a button/link to initiate an update action in my Phoenix project. The button should update the status
in my InjuredReserve
resource.
In development, it works as expected. However, in production I get a Plug.Conn.CookieOverflowError
with the message cookie named "_ex338_key" exceeds maximum size of 4096 bytes
.
Here is the code for the link in my InjuredReserveView
file:
link("Return",
to:
Routes.fantasy_league_injured_reserve_path(
conn,
:update,
fantasy_league.id,
injured_reserve.id,
%{"injured_reserve" => %{"status" => "returned"}}
),
data: [confirm: "Please confirm to return IR"],
method: :patch
)
Here is my InjuredReserveController.update
function:
def update(conn, %{
"fantasy_league_id" => league_id,
"id" => id,
"injured_reserve" => params
}) do
injured_reserve = InjuredReserves.get_ir!(id)
case InjuredReserves.update_injured_reserve(injured_reserve, params) do
{:ok, %{injured_reserve: _ir}} ->
conn
|> put_flash(:info, "IR successfully processed")
|> redirect(to: Routes.fantasy_league_injured_reserve_path(conn, :index, league_id))
{:error, _action, error, _} ->
conn
|> put_flash(:error, error)
|> redirect(to: Routes.fantasy_league_injured_reserve_path(conn, :index, league_id))
end
end
Is %{"injured_reserve" => %{"status" => "returned"}}
too much to send? What is a better way to accomplish this? Thanks!
Axel