Skip to content

Commit

Permalink
fix: change OTP config from string to BaseUrl
Browse files Browse the repository at this point in the history
  • Loading branch information
Jayanth-Parthsarathy committed Oct 9, 2024
1 parent d4638f2 commit 8252ec1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import Kernel.External.MultiModal.OpenTripPlanner.Types
import Kernel.External.MultiModal.Utils
import Kernel.Tools.Metrics.CoreMetrics (CoreMetrics)
import Kernel.Utils.Common hiding (id)
import Servant.Client.Core (showBaseUrl)

formatUtcDateTime :: UTCTime -> (String, String)
formatUtcDateTime utcTime = (dateString, timeString)
Expand Down Expand Up @@ -39,7 +40,7 @@ getTransitRoutes cfg req = do
lon = req.destination.location.latLng.longitude
}
let dateTime = req.departureTime <&> formatUtcDateTime
let planClient = fromString cfg.baseUrl
let planClient = fromString (showBaseUrl cfg.baseUrl)
let transportModes' = req.transportModes
resp <-
liftIO $
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
module Kernel.External.MultiModal.OpenTripPlanner.Config (OTPCfg) where
module Kernel.External.MultiModal.OpenTripPlanner.Config where

import Kernel.Prelude

data OTPCfg = OTPCfg
{ baseUrl :: String
{ baseUrl :: BaseUrl
}
deriving (Show, Eq, Generic, ToJSON, FromJSON)

0 comments on commit 8252ec1

Please sign in to comment.