summaryrefslogtreecommitdiff
path: root/server/Handlers.hs
diff options
context:
space:
mode:
authorstuebinm2022-02-25 16:30:45 +0100
committerstuebinm2022-02-25 16:30:45 +0100
commit55c2994e856ceaf82edd06587e2faffb7c58950c (patch)
tree8e8fa4d5dde7ccbf8c7445e3832bacd2f4a5f211 /server/Handlers.hs
parentd0226230a505a829bd01e0db910f75751860e9a0 (diff)
server: write out adjusted maps
Diffstat (limited to 'server/Handlers.hs')
-rw-r--r--server/Handlers.hs8
1 files changed, 5 insertions, 3 deletions
diff --git a/server/Handlers.hs b/server/Handlers.hs
index 719b475..93a7ae2 100644
--- a/server/Handlers.hs
+++ b/server/Handlers.hs
@@ -10,7 +10,7 @@ module Handlers (
-- , relintImpl
, stateImpl
, AdminOverview(..)
- ,MapService(..)) where
+ , MapService(..)) where
import Universum
@@ -24,7 +24,8 @@ import qualified Data.Map as M
import Servant (Handler, err404, throwError)
import Server (JobStatus (..), Org (orgUrl),
RemoteRef (RemoteRef, reponame), ServerState,
- Sha1, getJobStatus, unState)
+ Sha1, adjustedPath, getJobStatus, unState)
+
-- | an info type wrapped around the server state, to carry serialisation instances.
newtype AdminOverview =
@@ -54,7 +55,8 @@ instance ToJSON MapService where
_ -> Nothing
mapInfo rev mappath MapResult { .. } = A.object
[ "badges" .= mapresultBadges
- , "url" .= (orgUrl org <> rev <> "/" <> toText mappath) ]
+ -- TODO: type-safe url library for adding the slash?
+ , "url" .= (orgUrl org <> adjustedPath rev org <> "/" <> toText mappath) ]