Skip to content

Commit

Permalink
fix: fetch wheel price from .env at compile time
Browse files Browse the repository at this point in the history
  • Loading branch information
joaodiaslobo committed Nov 4, 2023
1 parent fa38b22 commit 1fc0e6f
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/safira_web/controllers/roulette_controller.ex
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ defmodule SafiraWeb.RouletteController do

action_fallback SafiraWeb.FallbackController

@price Application.compile_env!(:safira, :roulette_cost)

def spin(conn, _params) do
attendee = Accounts.get_user(conn) |> Map.fetch!(:attendee)

Expand All @@ -32,7 +34,6 @@ defmodule SafiraWeb.RouletteController do
end

def price(conn, _params) do
price = Application.fetch_env!(:safira, :roulette_cost)
render(conn, "price.json", price: price)
render(conn, "price.json", price: @price)
end
end

0 comments on commit 1fc0e6f

Please sign in to comment.