From 6bfb63ad24d23f3efebbc82a181ae19aaad1d5ff Mon Sep 17 00:00:00 2001 From: kotva006 Date: Wed, 8 May 2024 14:17:01 -0500 Subject: [PATCH] Updated the finder_api to use the predictions repo pattern --- lib/dotcom_web/controllers/schedule/finder_api.ex | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/dotcom_web/controllers/schedule/finder_api.ex b/lib/dotcom_web/controllers/schedule/finder_api.ex index bd62f7da48..679a3ccf72 100644 --- a/lib/dotcom_web/controllers/schedule/finder_api.ex +++ b/lib/dotcom_web/controllers/schedule/finder_api.ex @@ -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()}] @@ -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?,