Skip to content

Commit 8187533

Browse files
committed
Fix servant-client build
1 parent 0dcb81b commit 8187533

File tree

2 files changed

+17
-3
lines changed

2 files changed

+17
-3
lines changed

share-api/src/Share/Web/Share/Branches/Impl.hs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@ import Share.Web.Share.Projects.Types (projectToAPI)
5050
import Share.Web.Share.Types
5151
import U.Codebase.HashTags (CausalHash)
5252
import Unison.Codebase.Path qualified as Path
53-
import Unison.Debug qualified as Debug
5453
import Unison.HashQualified qualified as HQ
5554
import Unison.Name (Name)
5655
import Unison.NameSegment.Internal (NameSegment (..))
@@ -508,13 +507,11 @@ branchHistoryEndpoint (AuthN.MaybeAuthedUserID callerUserId) userHandle projectS
508507
let codebaseLoc = Codebase.codebaseLocationForProjectBranchCodebase projectOwnerUserId contributorId
509508
let codebase = Codebase.codebaseEnv authZReceipt codebaseLoc
510509
causalId <- resolveRootHash codebase branchHead Nothing
511-
Debug.debugM Debug.Temp "branchHistoryEndpoint Resolved causalId: " causalId
512510
PG.runTransaction do
513511
history <-
514512
CausalQ.pagedCausalAncestors causalId limit mayCursor
515513
<&> fmap \(causalHash) ->
516514
BranchHistoryCausalEntry (BranchHistoryCausal {causalHash})
517-
Debug.debugM Debug.Temp "branchHistoryEndpoint Retrieved history entries: " (history)
518515
pure $
519516
BranchHistoryResponse
520517
{ projectRef,

share-api/src/Share/Web/Share/Branches/Types.hs

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,13 @@ instance ToJSON BranchHistoryResponse where
107107
"history" .= history
108108
]
109109

110+
instance FromJSON BranchHistoryResponse where
111+
parseJSON = withObject "BranchHistoryResponse" $ \o ->
112+
BranchHistoryResponse
113+
<$> (o .: "projectRef")
114+
<*> (o .: "branchRef")
115+
<*> o .: "history"
116+
110117
data BranchHistoryCausal = BranchHistoryCausal
111118
{ causalHash :: CausalHash
112119
}
@@ -118,6 +125,11 @@ instance ToJSON BranchHistoryCausal where
118125
[ "causalHash" .= causalHash
119126
]
120127

128+
instance FromJSON BranchHistoryCausal where
129+
parseJSON = withObject "BranchHistoryCausal" $ \o ->
130+
BranchHistoryCausal
131+
<$> o .: "causalHash"
132+
121133
data BranchHistoryEntry
122134
= BranchHistoryCausalEntry BranchHistoryCausal
123135
deriving stock (Eq, Show)
@@ -126,3 +138,8 @@ instance ToJSON BranchHistoryEntry where
126138
toJSON = \case
127139
(BranchHistoryCausalEntry causal) ->
128140
toJSON (causal :++ (object ["tag" .= ("Changeset" :: Text)]))
141+
142+
instance FromJSON BranchHistoryEntry where
143+
parseJSON v = do
144+
causal <- parseJSON v
145+
return $ BranchHistoryCausalEntry causal

0 commit comments

Comments
 (0)