From 0bab60e1fb724254fd3fc400118883da36512bbe Mon Sep 17 00:00:00 2001 From: Orion Kindel Date: Tue, 28 Nov 2023 10:36:21 -0600 Subject: [PATCH] feat: list branch protections --- src/Gitea.Repo.BranchProtections.purs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/Gitea.Repo.BranchProtections.purs b/src/Gitea.Repo.BranchProtections.purs index bbfb40b..c103f07 100644 --- a/src/Gitea.Repo.BranchProtections.purs +++ b/src/Gitea.Repo.BranchProtections.purs @@ -28,6 +28,13 @@ get u r b = do rep <- HTTP.fetch $ HTTP.GET /\ url /\ Auth.headers auth Error.tryGetRepJSON rep +list :: forall m. MonadAff m => Username -> RepoName -> GiteaT m (Record BranchProtection) +list u r = do + { auth } <- ask + url <- branchProtectionURL u r + rep <- HTTP.fetch $ HTTP.GET /\ url /\ Auth.headers auth + Error.tryGetRepJSON rep + update :: forall m patch . MonadAff m