(httpClient *http.Client, repo ghrepo.Interface, id string, isPR bool, options Editable)
| 92 | } |
| 93 | |
| 94 | func replaceIssueFields(httpClient *http.Client, repo ghrepo.Interface, id string, isPR bool, options Editable) error { |
| 95 | apiClient := api.NewClientFromHTTP(httpClient) |
| 96 | |
| 97 | projectIds, err := options.ProjectIds() |
| 98 | if err != nil { |
| 99 | return err |
| 100 | } |
| 101 | |
| 102 | var assigneeIds *[]string |
| 103 | // TODO ApiActorsSupported |
| 104 | if !options.ApiActorsSupported { |
| 105 | assigneeIds, err = options.AssigneeIds(apiClient, repo) |
| 106 | if err != nil { |
| 107 | return err |
| 108 | } |
| 109 | } |
| 110 | |
| 111 | milestoneId, err := options.MilestoneId() |
| 112 | if err != nil { |
| 113 | return err |
| 114 | } |
| 115 | |
| 116 | if isPR { |
| 117 | params := githubv4.UpdatePullRequestInput{ |
| 118 | PullRequestID: id, |
| 119 | Title: ghString(options.TitleValue()), |
| 120 | Body: ghString(options.BodyValue()), |
| 121 | AssigneeIDs: ghIds(assigneeIds), |
| 122 | ProjectIDs: ghIds(projectIds), |
| 123 | MilestoneID: ghId(milestoneId), |
| 124 | } |
| 125 | if options.Base.Edited { |
| 126 | params.BaseRefName = ghString(&options.Base.Value) |
| 127 | } |
| 128 | return updatePullRequest(httpClient, repo, params) |
| 129 | } |
| 130 | |
| 131 | params := githubv4.UpdateIssueInput{ |
| 132 | ID: id, |
| 133 | Title: ghString(options.TitleValue()), |
| 134 | Body: ghString(options.BodyValue()), |
| 135 | AssigneeIDs: ghIds(assigneeIds), |
| 136 | ProjectIDs: ghIds(projectIds), |
| 137 | MilestoneID: ghId(milestoneId), |
| 138 | } |
| 139 | return updateIssue(httpClient, repo, params) |
| 140 | } |
| 141 | |
| 142 | func dirtyExcludingLabels(e Editable) bool { |
| 143 | return e.Title.Edited || |
no test coverage detected