(ctx context.DnoteCtx, tx *database.DB, note database.Note, bookName, content string)
| 97 | } |
| 98 | |
| 99 | func updateNote(ctx context.DnoteCtx, tx *database.DB, note database.Note, bookName, content string) error { |
| 100 | if bookName != "" { |
| 101 | if err := moveBook(ctx, tx, note, bookName); err != nil { |
| 102 | return errors.Wrap(err, "moving book") |
| 103 | } |
| 104 | } |
| 105 | if content != "" { |
| 106 | if err := changeContent(ctx, tx, note, content); err != nil { |
| 107 | return errors.Wrap(err, "changing content") |
| 108 | } |
| 109 | } |
| 110 | |
| 111 | return nil |
| 112 | } |
| 113 | |
| 114 | func runNote(ctx context.DnoteCtx, rowIDArg string) error { |
| 115 | err := validateRunNoteFlags() |
no test coverage detected