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

Function changeContent

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

Source from the content-addressed store, hash-verified

68}
69
70func changeContent(ctx context.DnoteCtx, tx *database.DB, note database.Note, content string) error {
71 if note.Body == content {
72 return errors.New("Nothing changed")
73 }
74
75 if err := database.UpdateNoteContent(tx, ctx.Clock, note.RowID, content); err != nil {
76 return errors.Wrap(err, "updating the note")
77 }
78
79 return nil
80}
81
82func moveBook(ctx context.DnoteCtx, tx *database.DB, note database.Note, bookName string) error {
83 targetBookUUID, err := database.GetBookUUID(tx, bookName)

Callers 1

updateNoteFunction · 0.85

Calls 2

UpdateNoteContentFunction · 0.92
NewMethod · 0.80

Tested by

no test coverage detected