From 3a7a5beb8e0de1bda097fec287ed00088556ff88 Mon Sep 17 00:00:00 2001 From: tees <12987958+teesloane@users.noreply.github.com> Date: Sun, 28 Apr 2024 12:06:35 -0400 Subject: [PATCH] Fix: crashing sort by on neighbourhoods (#348) * Fix: crashing sort by on neighbourhoods * Remove unnecessary case. --- lib/bike_brigade_web/live/campaign_signup_live/show.ex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/bike_brigade_web/live/campaign_signup_live/show.ex b/lib/bike_brigade_web/live/campaign_signup_live/show.ex index 269cff1b..fd4e436c 100644 --- a/lib/bike_brigade_web/live/campaign_signup_live/show.ex +++ b/lib/bike_brigade_web/live/campaign_signup_live/show.ex @@ -172,7 +172,7 @@ defmodule BikeBrigadeWeb.CampaignSignupLive.Show do defp assign_campaign(socket, campaign) do {riders, tasks} = Delivery.campaign_riders_and_tasks(campaign) - tasks = Enum.sort_by(tasks, fn t -> t.dropoff_location.neighborhood.name end) + tasks = Enum.sort_by(tasks, fn t -> Locations.neighborhood(t.dropoff_location) end) socket |> assign(:campaign, campaign)