Skip to content

Commit

Permalink
Updated the finder_api to use the predictions repo pattern
Browse files Browse the repository at this point in the history
  • Loading branch information
kotva006 committed May 8, 2024
1 parent f527f74 commit 6bfb63a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/dotcom_web/controllers/schedule/finder_api.ex
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ defmodule DotcomWeb.ScheduleController.FinderApi do
require Logger

@route_patterns_repo Application.compile_env!(:dotcom, :repo_modules)[:route_patterns]
@predictions_repo Application.compile_env!(:dotcom, :repo_modules)[:predictions]

@type react_keys :: :date | :direction | :is_current
@type react_strings :: [{react_keys, String.t()}]
Expand Down Expand Up @@ -217,7 +218,8 @@ defmodule DotcomWeb.ScheduleController.FinderApi do
direction_id: direction_id
]

predictions_fn = Map.get(conn.assigns, :predictions_fn, &Predictions.Repo.all/1)
predictions_fn =
Map.get(conn.assigns, :predictions_fn, Function.capture(@predictions_repo, :all, 1))

predictions =
if current_service?,
Expand Down

0 comments on commit 6bfb63a

Please sign in to comment.