Skip to content

Commit 753dc47

Browse files
committed
fix: return 500 when updated game reload fails in play_card
1 parent 7875687 commit 753dc47

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

copi.owasp.org/lib/copi_web/controllers/api_controller.ex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,11 @@ defmodule CopiWeb.ApiController do
2525
{:ok, dealt_card} ->
2626
with {:ok, updated_game} <- Game.find(game.id) do
2727
CopiWeb.Endpoint.broadcast(topic(game.id), "game:updated", updated_game)
28+
conn |> json(%{"id" => dealt_card.id})
2829
else
2930
{:error, _reason} ->
3031
conn |> put_status(:internal_server_error) |> json(%{"error" => "Could not find updated game"})
3132
end
32-
conn |> json(%{"id" => dealt_card.id})
3333
{:error, _changeset} ->
3434
conn |> put_status(:internal_server_error) |> json(%{"error" => "Could not update dealt card"})
3535
end

0 commit comments

Comments
 (0)