MCPcopy Index your code
hub / github.com/dnote/dnote / updateNote

Function updateNote

pkg/cli/cmd/edit/note.go:99–112  ·  view source on GitHub ↗
(ctx context.DnoteCtx, tx *database.DB, note database.Note, bookName, content string)

Source from the content-addressed store, hash-verified

97}
98
99func 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
114func runNote(ctx context.DnoteCtx, rowIDArg string) error {
115 err := validateRunNoteFlags()

Callers 1

runNoteFunction · 0.85

Calls 2

moveBookFunction · 0.85
changeContentFunction · 0.85

Tested by

no test coverage detected