MCPcopy Index your code
hub / github.com/cli/cli / buildEditDraftIssue

Function buildEditDraftIssue

pkg/cmd/project/item-edit/item_edit.go:185–207  ·  view source on GitHub ↗
(config editItemConfig, currentDraftIssue *queries.DraftIssue)

Source from the content-addressed store, hash-verified

183}
184
185func 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
209func buildUpdateItem(config editItemConfig, date time.Time) (*UpdateProjectV2FieldValue, map[string]interface{}) {
210 var value githubv4.ProjectV2FieldValue

Callers 1

updateDraftIssueFunction · 0.85

Calls 2

IDMethod · 0.65
StringMethod · 0.45

Tested by

no test coverage detected