Skip to content

Commit

Permalink
Refactor function name
Browse files Browse the repository at this point in the history
  • Loading branch information
dersmon committed Aug 6, 2024
1 parent 631be44 commit e0a0728
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions publication/lib/field_publication/publications/search.ex
Original file line number Diff line number Diff line change
Expand Up @@ -509,7 +509,7 @@ defmodule FieldPublication.Publications.Search do
config = Publications.get_configuration(pub)

{category_labels, field_labels} =
Enum.map(config, &extract_labels_for_item/1)
Enum.map(config, &extract_labels_for_configuration_item/1)
|> Enum.reduce({%{}, %{}}, fn {category_result, field_result},
{category_acc, field_acc} ->
{
Expand All @@ -525,6 +525,7 @@ defmodule FieldPublication.Publications.Search do
}
end)
|> Enum.reduce(
# We now merge the label information for all projects into one accumulator.
%{category_labels: %{}, field_labels: %{}},
fn {
project_name,
Expand Down Expand Up @@ -560,7 +561,7 @@ defmodule FieldPublication.Publications.Search do
info
end

defp extract_labels_for_item(%{
defp extract_labels_for_configuration_item(%{
"item" => %{
"label" => label,
"name" => name,
Expand All @@ -576,7 +577,7 @@ defmodule FieldPublication.Publications.Search do

{child_category_labels, child_field_labels} =
child_categories
|> Enum.map(&extract_labels_for_item/1)
|> Enum.map(&extract_labels_for_configuration_item/1)
|> Enum.reduce({%{}, %{}}, fn {category_result, field_result}, {category_acc, field_acc} ->
{
Map.merge(category_result, category_acc),
Expand Down

0 comments on commit e0a0728

Please sign in to comment.