UpdateNoteContent updates the note content and marks the note as dirty
(db *DB, c clock.Clock, rowID int, content string)
| 192 | |
| 193 | // UpdateNoteContent updates the note content and marks the note as dirty |
| 194 | func UpdateNoteContent(db *DB, c clock.Clock, rowID int, content string) error { |
| 195 | ts := c.Now().UnixNano() |
| 196 | |
| 197 | _, err := db.Exec(`UPDATE notes |
| 198 | SET body = ?, edited_on = ?, dirty = ? |
| 199 | WHERE rowid = ?`, content, ts, true, rowID) |
| 200 | if err != nil { |
| 201 | return errors.Wrap(err, "updating the note") |
| 202 | } |
| 203 | |
| 204 | return nil |
| 205 | } |
| 206 | |
| 207 | // UpdateNoteBook moves the note to a different book and marks the note as dirty |
| 208 | func UpdateNoteBook(db *DB, c clock.Clock, rowID int, bookUUID string) error { |