MCPcopy
hub / github.com/cli/cli / updateItemValues

Function updateItemValues

pkg/cmd/project/item-edit/item_edit.go:315–340  ·  view source on GitHub ↗
(config editItemConfig)

Source from the content-addressed store, hash-verified

313}
314
315func updateItemValues(config editItemConfig) error {
316 if err := fieldIdAndProjectIdPresence(config); err != nil {
317 return err
318 }
319
320 var parsedDate time.Time
321 if config.opts.date != "" {
322 date, err := time.Parse("2006-01-02", config.opts.date)
323 if err != nil {
324 return err
325 }
326 parsedDate = date
327 }
328
329 query, variables := buildUpdateItem(config, parsedDate)
330 err := config.client.Mutate("UpdateItemValues", query, variables)
331 if err != nil {
332 return err
333 }
334
335 if config.opts.exporter != nil {
336 return config.opts.exporter.Write(config.io, &query.Update.Item)
337 }
338
339 return printItemResults(config, &query.Update.Item)
340}
341
342func fieldIdAndProjectIdPresence(config editItemConfig) error {
343 if config.opts.fieldID == "" && config.opts.projectID == "" {

Callers 1

runEditItemFunction · 0.85

Calls 5

buildUpdateItemFunction · 0.85
printItemResultsFunction · 0.85
MutateMethod · 0.65
WriteMethod · 0.65

Tested by

no test coverage detected