From 55c2994e856ceaf82edd06587e2faffb7c58950c Mon Sep 17 00:00:00 2001 From: stuebinm Date: Fri, 25 Feb 2022 16:30:45 +0100 Subject: server: write out adjusted maps --- server/Handlers.hs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'server/Handlers.hs') 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) ] -- cgit v1.2.3