From 16c2690af410ecec4ab87458a22420d22d5d1b5e Mon Sep 17 00:00:00 2001 From: 6543 <6543@noreply.gitea.io> Date: Mon, 3 Feb 2020 02:45:18 +0000 Subject: [PATCH] Remove ListUserIssues() ... (#262) Merge branch 'master' into rm-ListUserIssues correct version (#257) Merge branch 'master' into targed-version Extend Issue Struct (#258) fix extend IssueTest add Repository to Issue struct Co-authored-by: 6543 <6543@obermui.de> Reviewed-on: https://gitea.com/gitea/go-sdk/pulls/258 Reviewed-by: Andrew Thornton Reviewed-by: Lunny Xiao Merge branch 'master' into targed-version format code (#245) fix if test is to fast remove lgtm bot config (gitea handle this now) format code Add GetIssueComment (#216) Merge branch 'master' into update-comment-api Fix & Refactor UserApp Functions (#247) Merge branch 'master' into refactor-user-app Add SearchRepo API Call (#254) Merge branch 'master' into search_repo IssueSubscribtion: Check http Status responce (#242) Merge branch 'master' into impruve-issueWatch Refactor RepoWatch (#241) Merge branch 'master' into refactor-repoWatch Add ListMilestoneOption to ListRepoMilestones (#244) use StateType use PageSize adjut test since gitea bug got fixed (#gitea/10047) add TestMilestones add optional ListMilestoneOption format Add ListOptions struct (#249) same struct as in models/list_options.go add mising license header add ListOptions struct Co-authored-by: 6543 <6543@obermui.de> Reviewed-on: https://gitea.com/gitea/go-sdk/pulls/249 Reviewed-by: Andrew Thornton Reviewed-by: lafriks [README] add import path (#239) add import path add import path to readme Changelog v0.11.0 (#235) Co-authored-by: techknowlogick Co-authored-by: 6543 <6543@obermui.de> Reviewed-on: https://gitea.com/gitea/go-sdk/pulls/235 Reviewed-by: lafriks Reviewed-by: Andrew Thornton Reviewed-by: John Olheiser Add TestMyUser (#237) Co-authored-by: 6543 <6543@obermui.de> Reviewed-on: https://gitea.com/gitea/go-sdk/pulls/237 Reviewed-by: lafriks Reviewed-by: Andrew Thornton Reviewed-on: https://gitea.com/gitea/go-sdk/pulls/239 Reviewed-by: Lunny Xiao Reviewed-by: John Olheiser Co-authored-by: 6543 <6543@obermui.de> Reviewed-on: https://gitea.com/gitea/go-sdk/pulls/244 Reviewed-by: Lunny Xiao Reviewed-by: Andrew Thornton Merge branch 'master' into refactor-repoWatch Add ListOptions struct (#249) same struct as in models/list_options.go add mising license header add ListOptions struct Co-authored-by: 6543 <6543@obermui.de> Reviewed-on: https://gitea.com/gitea/go-sdk/pulls/249 Reviewed-by: Andrew Thornton Reviewed-by: lafriks add TEST fix GetMyWatchedRepos [README] add import path (#239) add import path add import path to readme Changelog v0.11.0 (#235) Co-authored-by: techknowlogick Co-authored-by: 6543 <6543@obermui.de> Reviewed-on: https://gitea.com/gitea/go-sdk/pulls/235 Reviewed-by: lafriks Reviewed-by: Andrew Thornton Reviewed-by: John Olheiser Add TestMyUser (#237) Co-authored-by: 6543 <6543@obermui.de> Reviewed-on: https://gitea.com/gitea/go-sdk/pulls/237 Reviewed-by: lafriks Reviewed-by: Andrew Thornton Reviewed-on: https://gitea.com/gitea/go-sdk/pulls/239 Reviewed-by: Lunny Xiao Reviewed-by: John Olheiser refactor RepoWatch * add CheckRepoWatch * add GetMyWatchedRepos * minimize func_options on GetWatchedRepos * WatchRepo return nil/error * UnWatchRepo return nil/error Co-authored-by: Lunny Xiao Co-authored-by: 6543 <6543@obermui.de> Reviewed-on: https://gitea.com/gitea/go-sdk/pulls/241 Reviewed-by: Andrew Thornton Reviewed-by: Andrew Thornton Reviewed-by: Lunny Xiao Merge branch 'master' into impruve-issueWatch Add ListMilestoneOption to ListRepoMilestones (#244) use StateType use PageSize adjut test since gitea bug got fixed (#gitea/10047) add TestMilestones add optional ListMilestoneOption format Add ListOptions struct (#249) same struct as in models/list_options.go add mising license header add ListOptions struct Co-authored-by: 6543 <6543@obermui.de> Reviewed-on: https://gitea.com/gitea/go-sdk/pulls/249 Reviewed-by: Andrew Thornton Reviewed-by: lafriks [README] add import path (#239) add import path add import path to readme Changelog v0.11.0 (#235) Co-authored-by: techknowlogick Co-authored-by: 6543 <6543@obermui.de> Reviewed-on: https://gitea.com/gitea/go-sdk/pulls/235 Reviewed-by: lafriks Reviewed-by: Andrew Thornton Reviewed-by: John Olheiser Add TestMyUser (#237) Co-authored-by: 6543 <6543@obermui.de> Reviewed-on: https://gitea.com/gitea/go-sdk/pulls/237 Rev... Co-authored-by: Lunny Xiao Co-authored-by: 6543 <6543@obermui.de> Reviewed-on: https://gitea.com/gitea/go-sdk/pulls/262 Reviewed-by: Andrew Thornton Reviewed-by: Lunny Xiao --- gitea/issue.go | 21 --------------------- 1 file changed, 21 deletions(-) diff --git a/gitea/issue.go b/gitea/issue.go index 57cc41b..f5b2512 100644 --- a/gitea/issue.go +++ b/gitea/issue.go @@ -94,27 +94,6 @@ func (c *Client) ListIssues(opt ListIssueOption) ([]*Issue, error) { return issues, c.getParsedResponse("GET", link.String(), jsonHeader, nil, &issues) } -// ListUserIssues returns all issues assigned to the authenticated user -func (c *Client) ListUserIssues(opt ListIssueOption) ([]*Issue, error) { - // WARNING: "/user/issues" API is not implemented jet! - allIssues, err := c.ListIssues(opt) - if err != nil { - return nil, err - } - user, err := c.GetMyUserInfo() - if err != nil { - return nil, err - } - // Workaround: client sort out non user related issues - issues := make([]*Issue, 0, 10) - for _, i := range allIssues { - if i.ID == user.ID { - issues = append(issues, i) - } - } - return issues, nil -} - // ListRepoIssues returns all issues for a given repository func (c *Client) ListRepoIssues(owner, repo string, opt ListIssueOption) ([]*Issue, error) { link, _ := url.Parse(fmt.Sprintf("/repos/%s/%s/issues", owner, repo))