MCPcopy Create free account
hub / github.com/cli/cli / updateItemValues

Function updateItemValues

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

Source from the content-addressed store, hash-verified

470}
471
472func updateItemValues(config editItemConfig) error {
473 if err := fieldIdAndProjectIdPresence(config); err != nil {
474 return err
475 }
476
477 var parsedDate time.Time
478 if config.opts.date != "" {
479 date, err := time.Parse("2006-01-02", config.opts.date)
480 if err != nil {
481 return err
482 }
483 parsedDate = date
484 }
485
486 query, variables := buildUpdateItem(config, parsedDate)
487 err := config.client.Mutate("UpdateItemValues", query, variables)
488 if err != nil {
489 return err
490 }
491
492 if config.opts.exporter != nil {
493 return config.opts.exporter.Write(config.io, &query.Update.Item)
494 }
495
496 return printItemResults(config, &query.Update.Item)
497}
498
499func fieldIdAndProjectIdPresence(config editItemConfig) error {
500 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