diff --git a/lib/bike_brigade/riders.ex b/lib/bike_brigade/riders.ex index 767ac980..66405b22 100644 --- a/lib/bike_brigade/riders.ex +++ b/lib/bike_brigade/riders.ex @@ -199,16 +199,6 @@ defmodule BikeBrigade.Riders do end end - # TODO: make it pretty - # TODO This may not be needed, i think it's only used when creating riders from a form input which we don't seem to do? - def create_rider_with_tags(attrs \\ %{}, tags \\ [], opts \\ []) do - %Rider{} - |> Rider.changeset(attrs) - |> Rider.tags_changeset(tags) - |> Repo.insert(opts) - |> broadcast(:rider_created) - end - @doc """ Updates a rider. diff --git a/lib/bike_brigade_web/live/rider_live/form_component.ex b/lib/bike_brigade_web/live/rider_live/form_component.ex index 98e02370..552a33f4 100644 --- a/lib/bike_brigade_web/live/rider_live/form_component.ex +++ b/lib/bike_brigade_web/live/rider_live/form_component.ex @@ -154,21 +154,6 @@ defmodule BikeBrigadeWeb.RiderLive.FormComponent do save_rider_edit_impl(socket, rider_form_params) end - # TODO: this can probably be deleted: we don't really create riders from the form? - # https://github.com/bikebrigade/dispatch/issues/321 - defp save_rider(socket, :new, rider_params) do - case Riders.create_rider_with_tags(rider_params, rider_params["tags"]) do - {:ok, _rider} -> - {:noreply, - socket - |> put_flash(:info, "Rider created successfully") - |> push_navigate(to: socket.assigns.navigate)} - - {:error, %Ecto.Changeset{} = changeset} -> - {:noreply, assign(socket, changeset: changeset)} - end - end - defp save_rider_edit_impl(socket, rider_form_params) do rider_form_params = Map.merge(%{"tags" => []}, rider_form_params) diff --git a/lib/bike_brigade_web/router.ex b/lib/bike_brigade_web/router.ex index 1859f7df..7265e16e 100644 --- a/lib/bike_brigade_web/router.ex +++ b/lib/bike_brigade_web/router.ex @@ -118,7 +118,6 @@ defmodule BikeBrigadeWeb.Router do live_session :dispatch, on_mount: {LiveHooks.Authentication, :require_dispatcher} do live "/riders", RiderLive.Index, :index - live "/riders/new", RiderLive.Index, :new live "/riders/message", RiderLive.Index, :message # this is mostly used for testing! live "/riders/map", RiderLive.Index, :map