Skip to content

Commit

Permalink
fix: handle not found auction bids
Browse files Browse the repository at this point in the history
  • Loading branch information
sborrazas committed Apr 26, 2024
1 parent 1cd473a commit e416a4d
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions lib/ae_mdw_web/controllers/name_controller.ex
Expand Up @@ -57,8 +57,12 @@ defmodule AeMdwWeb.NameController do
def auction(%Conn{assigns: %{state: state, opts: opts}} = conn, %{"id" => ident}) do
opts = [{:render_v3?, true} | opts]

with {:ok, auction_bid} <- AuctionBids.fetch(state, ident, opts) do
format_json(conn, auction_bid)
case AuctionBids.fetch(state, ident, opts) do
{:ok, auction_bid} ->
format_json(conn, auction_bid)

:not_found ->
{:error, ErrInput.NotFound.exception(value: ident)}
end
end

Expand Down

0 comments on commit e416a4d

Please sign in to comment.