Skip to content

Commit

Permalink
Bubble up return value from inner function calls in runEditItem
Browse files Browse the repository at this point in the history
  • Loading branch information
andyfeller authored and arunsathiya committed Oct 2, 2023
1 parent 45e4bf7 commit c8b4652
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions pkg/cmd/project/item-edit/item_edit.go
Expand Up @@ -138,23 +138,17 @@ func NewCmdEditItem(f *cmdutil.Factory, runF func(config editItemConfig) error)
func runEditItem(config editItemConfig) error {
// when clear flag is used, remove value set to the corresponding field ID
if config.opts.clear {
if err := clearItemFieldValue(config); err != nil {
return err
}
return clearItemFieldValue(config)
}

// update draft issue
if config.opts.title != "" || config.opts.body != "" {
if err := updateDraftIssue(config); err != nil {
return err
}
return updateDraftIssue(config)
}

// update item values
if config.opts.text != "" || config.opts.number != 0 || config.opts.date != "" || config.opts.singleSelectOptionID != "" || config.opts.iterationID != "" {
if err := updateItemValues(config); err != nil {
return err
}
return updateItemValues(config)
}

if _, err := fmt.Fprintln(config.io.ErrOut, "error: no changes to make"); err != nil {
Expand Down

0 comments on commit c8b4652

Please sign in to comment.