Skip to content

Commit 17d90d7

Browse files
committed
Add history comments to api
1 parent 856a143 commit 17d90d7

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

share-api/src/Share/Web/API.hs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ import Share.Web.Share.Webhooks.API qualified as Webhooks
1818
import Share.Web.Support.API qualified as Support
1919
import Share.Web.Types
2020
import Share.Web.UCM.SyncV2.API qualified as SyncV2
21+
import Unison.Server.HistoryComments.API qualified as Unison.HistoryComments
2122
import Unison.Share.API.Projects qualified as UCMProjects
2223
import Unison.Sync.API qualified as Unison.Sync
2324

@@ -53,6 +54,7 @@ type API =
5354
-- This path is deprecated, but is still in use by existing clients.
5455
:<|> ("sync" :> MaybeAuthenticatedSession :> Unison.Sync.API)
5556
:<|> ("ucm" :> "v1" :> "sync" :> MaybeAuthenticatedSession :> Unison.Sync.API)
57+
:<|> ("ucm" :> "v1" :> "history-comments" :> MaybeAuthenticatedSession :> Unison.HistoryComments.API)
5658
:<|> ("ucm" :> "v1" :> "projects" :> MaybeAuthenticatedSession :> UCMProjects.ProjectsAPI)
5759
:<|> ("ucm" :> "v2" :> "sync" :> MaybeAuthenticatedUserId :> SyncV2.API)
5860
:<|> ("admin" :> Admin.API)

share-api/src/Share/Web/UCM/HistoryComments/Impl.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ uploadHistoryCommentsStreamImpl mayCallerUserId br@(BranchRef branchRef) conn =
6767
branch <- MaybeT $ PGQ.branchByProjectBranchShortHand projectBranchSH
6868
contributorUser <- MaybeT $ for contributorHandle UserQ.userByHandle
6969
pure (project, branch, contributorUser)
70-
(project, branch, contributorUser) <- maybe (handleErrInQueue q $ UploadCommentsProjectBranchNotFound br) pure $ mayInfo
70+
(project, _branch, contributorUser) <- maybe (handleErrInQueue q $ UploadCommentsProjectBranchNotFound br) pure $ mayInfo
7171
authZ <-
7272
lift (AuthZ.checkUploadToProjectBranchCodebase callerUserId project.projectId contributorUser.user_id) >>= \case
7373
Left _authErr -> handleErrInQueue q (UploadCommentsNotAuthorized br)

0 commit comments

Comments
 (0)