From be215c85da40647698e806a26806907cffbc1d44 Mon Sep 17 00:00:00 2001 From: Harshad Sharma Date: Sun, 19 May 2024 14:59:13 +0530 Subject: [PATCH] Sort search results alphabetically --- lib/freedive_web/live/service_live.ex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/freedive_web/live/service_live.ex b/lib/freedive_web/live/service_live.ex index 38b1cd8..b12c8a9 100644 --- a/lib/freedive_web/live/service_live.ex +++ b/lib/freedive_web/live/service_live.ex @@ -167,7 +167,7 @@ defmodule FreediveWeb.ServiceLive.Components do def items_block(assigns) do ~H""" - <%= for {_name, item} <- @items do %> + <%= for {_name, item} <- Enum.sort(@items, fn {a, _}, {b, _} -> a < b end) do %> <.service_preview item={item} selected_item={@selected_item} /> <% end %> """