diff --git a/lib/cannery/ammo.ex b/lib/cannery/ammo.ex index 67c145bb..186cdd88 100644 --- a/lib/cannery/ammo.ex +++ b/lib/cannery/ammo.ex @@ -90,7 +90,7 @@ defmodule Cannery.Ammo do from ag in AmmoGroup, where: ag.ammo_type_id == ^ammo_type_id, select: sum(ag.count) - ) + ) || 0 end @doc """ @@ -117,7 +117,7 @@ defmodule Cannery.Ammo do left_join: sg in assoc(ag, :shot_groups), where: ag.ammo_type_id == ^ammo_type_id, select: sum(sg.count) - ) + ) || 0 end @doc """ diff --git a/lib/cannery_web/live/ammo_type_live/show.html.heex b/lib/cannery_web/live/ammo_type_live/show.html.heex index 1ad98f8b..f8811635 100644 --- a/lib/cannery_web/live/ammo_type_live/show.html.heex +++ b/lib/cannery_web/live/ammo_type_live/show.html.heex @@ -100,9 +100,8 @@ ) %> <% else %> -