26 lines
608 B
Elixir
26 lines
608 B
Elixir
defmodule BeetRoundServerWeb.BiddingRoundJSON do
|
|
alias BeetRoundServer.BiddingRounds.BiddingRound
|
|
|
|
@doc """
|
|
Renders a list of bidding_rounds.
|
|
"""
|
|
def index(%{bidding_rounds: bidding_rounds}) do
|
|
%{data: for(bidding_round <- bidding_rounds, do: data(bidding_round))}
|
|
end
|
|
|
|
@doc """
|
|
Renders a single bidding_round.
|
|
"""
|
|
def show(%{bidding_round: bidding_round}) do
|
|
%{data: data(bidding_round)}
|
|
end
|
|
|
|
defp data(%BiddingRound{} = bidding_round) do
|
|
%{
|
|
id: bidding_round.id,
|
|
round_number: bidding_round.round_number,
|
|
stopped: bidding_round.stopped
|
|
}
|
|
end
|
|
end
|