improve Ammo.list_types
This commit is contained in:
@ -3,7 +3,7 @@ defmodule CanneryWeb.ExportController do
|
||||
alias Cannery.{ActivityLog, Ammo, Containers}
|
||||
|
||||
def export(%{assigns: %{current_user: current_user}} = conn, %{"mode" => "json"}) do
|
||||
types = Ammo.list_types(current_user, :all)
|
||||
types = Ammo.list_types(current_user)
|
||||
used_counts = types |> ActivityLog.get_used_count_for_types(current_user)
|
||||
round_counts = types |> Ammo.get_round_count_for_types(current_user)
|
||||
pack_counts = types |> Ammo.get_packs_count_for_types(current_user)
|
||||
|
@ -26,7 +26,7 @@ defmodule CanneryWeb.PackLive.FormComponent do
|
||||
socket =
|
||||
socket
|
||||
|> assign(:pack_create_limit, @pack_create_limit)
|
||||
|> assign(:types, Ammo.list_types(current_user, :all))
|
||||
|> assign(:types, Ammo.list_types(current_user))
|
||||
|> assign_new(:containers, fn -> Containers.list_containers(current_user) end)
|
||||
|
||||
params =
|
||||
|
@ -106,7 +106,7 @@ defmodule CanneryWeb.TypeLive.Index do
|
||||
) do
|
||||
socket
|
||||
|> assign(
|
||||
types: Ammo.list_types(search, current_user, class),
|
||||
types: Ammo.list_types(current_user, class: class, search: search),
|
||||
types_count: Ammo.get_types_count!(current_user)
|
||||
)
|
||||
end
|
||||
|
Reference in New Issue
Block a user