use pointers for optional update fields to distinguish empty from unset
This commit is contained in:
@@ -45,7 +45,8 @@ var editCmd = &cobra.Command{
|
||||
}
|
||||
|
||||
if content, err := os.ReadFile(tmp.Name()); err == nil {
|
||||
if err := d.UpdateNode(args[0], db.UpdateParams{Content: string(content)}); err != nil {
|
||||
c := string(content)
|
||||
if err := d.UpdateNode(args[0], db.UpdateParams{Content: &c}); err != nil {
|
||||
fmt.Fprintln(os.Stderr, "failed to update:", err)
|
||||
return
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user