This repository has been archived on 2022-08-13. You can view files and clone it, but cannot push or open issues or pull requests.
dedibox_prices/lib/dedibox_prices_web/controllers/page_controller.ex

10 lines
296 B
Elixir

defmodule DediboxPricesWeb.PageController do
use DediboxPricesWeb, :controller
alias DediboxPrices.Entities.Offers
def index(conn, _params) do
recents = Offers.most_recents |> Enum.sort(fn (o1, o2) -> o1.price < o2.price end)
render(conn, "index.html", recents: recents)
end
end