UpdateNoteBook moves the note to a different book and marks the note as dirty
(db *DB, c clock.Clock, rowID int, bookUUID string)
| 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 { |
| 209 | ts := c.Now().UnixNano() |
| 210 | |
| 211 | _, err := db.Exec(`UPDATE notes |
| 212 | SET book_uuid = ?, edited_on = ?, dirty = ? |
| 213 | WHERE rowid = ?`, bookUUID, ts, true, rowID) |
| 214 | if err != nil { |
| 215 | return errors.Wrap(err, "updating the note") |
| 216 | } |
| 217 | |
| 218 | return nil |
| 219 | } |