cannery/lib/cannery_web/live/home_live.ex
shibao a54cf8b87d
All checks were successful
continuous-integration/drone/push Build is passing
use strict context boundaries and remove all n+1 queries
2023-03-18 21:06:50 -04:00

18 lines
418 B
Elixir

defmodule CanneryWeb.HomeLive do
@moduledoc """
Liveview for the home page
"""
use CanneryWeb, :live_view
alias Cannery.Accounts
alias CanneryWeb.Endpoint
@version Mix.Project.config()[:version]
@impl true
def mount(_params, _session, socket) do
admins = Accounts.list_users_by_role(:admin)
{:ok, socket |> assign(page_title: gettext("Home"), admins: admins, version: @version)}
end
end