forked from shibao/cannery
		
	rename Ammo.get_average_cost and Ammo.get_historical_count
This commit is contained in:
		@@ -153,13 +153,13 @@ defmodule CanneryWeb.Components.TypeTableComponent do
 | 
			
		||||
 | 
			
		||||
    round_counts = Ammo.get_grouped_round_count(current_user, types: types, group_by: :type_id)
 | 
			
		||||
    packs_count = Ammo.get_grouped_packs_count(current_user, types: types, group_by: :type_id)
 | 
			
		||||
    average_costs = types |> Ammo.get_average_cost_for_types(current_user)
 | 
			
		||||
    average_costs = Ammo.get_average_costs(types, current_user)
 | 
			
		||||
 | 
			
		||||
    [used_counts, historical_round_counts, historical_pack_counts, used_pack_counts] =
 | 
			
		||||
      if show_used do
 | 
			
		||||
        [
 | 
			
		||||
          ActivityLog.get_grouped_used_counts(current_user, types: types, group_by: :type_id),
 | 
			
		||||
          types |> Ammo.get_historical_count_for_types(current_user),
 | 
			
		||||
          Ammo.get_historical_counts(types, current_user),
 | 
			
		||||
          Ammo.get_grouped_packs_count(current_user,
 | 
			
		||||
            types: types,
 | 
			
		||||
            group_by: :type_id,
 | 
			
		||||
 
 | 
			
		||||
@@ -14,7 +14,7 @@ defmodule CanneryWeb.ExportController do
 | 
			
		||||
    total_pack_counts =
 | 
			
		||||
      Ammo.get_grouped_packs_count(current_user, types: types, group_by: :type_id, show_used: true)
 | 
			
		||||
 | 
			
		||||
    average_costs = types |> Ammo.get_average_cost_for_types(current_user)
 | 
			
		||||
    average_costs = Ammo.get_average_costs(types, current_user)
 | 
			
		||||
 | 
			
		||||
    types =
 | 
			
		||||
      types
 | 
			
		||||
 
 | 
			
		||||
@@ -69,7 +69,7 @@ defmodule CanneryWeb.TypeLive.Show do
 | 
			
		||||
          Ammo.get_packs_count(current_user, type_id: type.id, show_used: :only_used),
 | 
			
		||||
          Ammo.get_packs_count(current_user, type_id: type.id, show_used: true),
 | 
			
		||||
          ActivityLog.get_used_count(current_user, type_id: type.id),
 | 
			
		||||
          type |> Ammo.get_historical_count_for_type(current_user)
 | 
			
		||||
          Ammo.get_historical_count(type, current_user)
 | 
			
		||||
        ]
 | 
			
		||||
      else
 | 
			
		||||
        [nil, nil, nil, nil, nil]
 | 
			
		||||
@@ -94,7 +94,7 @@ defmodule CanneryWeb.TypeLive.Show do
 | 
			
		||||
      containers: containers,
 | 
			
		||||
      cprs: packs |> Ammo.get_cprs(current_user),
 | 
			
		||||
      last_used_dates: packs |> ActivityLog.get_last_used_dates(current_user),
 | 
			
		||||
      avg_cost_per_round: type |> Ammo.get_average_cost_for_type(current_user),
 | 
			
		||||
      avg_cost_per_round: Ammo.get_average_cost(type, current_user),
 | 
			
		||||
      rounds: Ammo.get_round_count(current_user, type_id: type.id),
 | 
			
		||||
      original_counts: original_counts,
 | 
			
		||||
      used_rounds: used_rounds,
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user