Skip to content

Use IssueNumber in editIssueR and issueR #429

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 11, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions spec/GitHub/IssuesSpec.hs
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,11 @@ spec = do
cms <- GitHub.executeRequest auth $
GitHub.commentsR owner repo (GitHub.issueNumber i) 1
cms `shouldSatisfy` isRight
describe "issueR" $ do
it "fetches issue #428" $ withAuth $ \auth -> do
resIss <- GitHub.executeRequest auth $
GitHub.issueR "phadej" "github" (GitHub.IssueNumber 428)
resIss `shouldSatisfy` isRight
where
repos =
[ ("thoughtbot", "paperclip")
Expand Down
4 changes: 2 additions & 2 deletions src/GitHub/Endpoints/Issues.hs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ organizationIssuesR org opts =

-- | Query a single issue.
-- See <https://developer.github.com/v3/issues/#get-a-single-issue>
issueR :: Name Owner -> Name Repo -> Id Issue -> Request k Issue
issueR :: Name Owner -> Name Repo -> IssueNumber -> Request k Issue
issueR user reqRepoName reqIssueNumber =
query ["repos", toPathPart user, toPathPart reqRepoName, "issues", toPathPart reqIssueNumber] []

Expand Down Expand Up @@ -63,6 +63,6 @@ editOfIssue = EditIssue Nothing Nothing Nothing Nothing Nothing Nothing

-- | Edit an issue.
-- See <https://developer.github.com/v3/issues/#edit-an-issue>
editIssueR :: Name Owner -> Name Repo -> Id Issue -> EditIssue -> Request 'RW Issue
editIssueR :: Name Owner -> Name Repo -> IssueNumber -> EditIssue -> Request 'RW Issue
editIssueR user repo iss =
command Patch ["repos", toPathPart user, toPathPart repo, "issues", toPathPart iss] . encode