summaryrefslogtreecommitdiff
path: root/server/Server.hs
diff options
context:
space:
mode:
authorstuebinm2022-04-03 02:33:37 +0200
committerstuebinm2022-04-03 02:33:37 +0200
commit1db21885df2bd99d65a5aac43bd7fc35ea0ff767 (patch)
tree47411b012eb3b97767c0b3b4212390046b779a0a /server/Server.hs
parentdea6636bde162f0ce762cc3567b92a0e1255ce54 (diff)
server: fix map paths in api
Diffstat (limited to 'server/Server.hs')
-rw-r--r--server/Server.hs9
1 files changed, 6 insertions, 3 deletions
diff --git a/server/Server.hs b/server/Server.hs
index 0c09314..b07cb58 100644
--- a/server/Server.hs
+++ b/server/Server.hs
@@ -30,7 +30,7 @@ module Server ( loadConfig
, ServerState, emptyState, unState
, JobStatus(..)
, prettySha,getJobStatus,overJobStatus
- , adjustedPath,RealtimeMsg(..),newRealtimeChannel) where
+ , adjustedPath,RealtimeMsg(..),newRealtimeChannel,adjustedWebPath) where
import Universum
@@ -269,9 +269,12 @@ getJobStatus mvar orgslug sha = withMVar mvar $ \state -> pure $ do
-- | the path (relative to a baseurl / webdir) where an adjusted
-- map should go
adjustedPath :: Text -> Org True -> Text -- TODO: filepath library using Text?
-adjustedPath rev Org {..} =
- orgWebdir <> "/" <> (rev <> show orgGeneration)
+adjustedPath rev org@Org {..} =
+ orgWebdir <> "/" <> adjustedWebPath rev org
+adjustedWebPath :: Text -> Org True -> Text
+adjustedWebPath rev Org {..} =
+ rev <> show orgGeneration
newRealtimeChannel :: IO RealtimeChannel
newRealtimeChannel = atomically newBroadcastTChan