(config editItemConfig, currentDraftIssue *queries.DraftIssue)
| 183 | } |
| 184 | |
| 185 | func buildEditDraftIssue(config editItemConfig, currentDraftIssue *queries.DraftIssue) (*EditProjectDraftIssue, map[string]interface{}) { |
| 186 | input := githubv4.UpdateProjectV2DraftIssueInput{ |
| 187 | DraftIssueID: githubv4.ID(config.opts.itemID), |
| 188 | } |
| 189 | |
| 190 | if config.opts.titleChanged { |
| 191 | input.Title = githubv4.NewString(githubv4.String(config.opts.title)) |
| 192 | } else if currentDraftIssue != nil { |
| 193 | // Preserve existing if title is not provided |
| 194 | input.Title = githubv4.NewString(githubv4.String(currentDraftIssue.Title)) |
| 195 | } |
| 196 | |
| 197 | if config.opts.bodyChanged { |
| 198 | input.Body = githubv4.NewString(githubv4.String(config.opts.body)) |
| 199 | } else if currentDraftIssue != nil { |
| 200 | // Preserve existing if body is not provided |
| 201 | input.Body = githubv4.NewString(githubv4.String(currentDraftIssue.Body)) |
| 202 | } |
| 203 | |
| 204 | return &EditProjectDraftIssue{}, map[string]interface{}{ |
| 205 | "input": input, |
| 206 | } |
| 207 | } |
| 208 | |
| 209 | func buildUpdateItem(config editItemConfig, date time.Time) (*UpdateProjectV2FieldValue, map[string]interface{}) { |
| 210 | var value githubv4.ProjectV2FieldValue |
no test coverage detected