diff --git a/core/src/local/store.rs b/core/src/local/store.rs index 07bef6b..1c36f17 100644 --- a/core/src/local/store.rs +++ b/core/src/local/store.rs @@ -373,6 +373,19 @@ pub fn create_note(conn: &Connection, input: &NoteCreateInput) -> rusqlite::Resu load_note(conn, &id) } +fn snapshot_revision(conn: &Connection, id: &str) -> rusqlite::Result<()> { + let (title, body): (Option, String) = + conn.query_row("SELECT title, body FROM notes WHERE id = ?1", [id], |r| { + Ok((r.get(0)?, r.get(1)?)) + })?; + conn.execute( + "INSERT INTO note_revisions (id, note_id, title, body, created_at) VALUES (?1, ?2, ?3, ?4, ?5)", + params![new_id(), id, title, body, now()], + )?; + Ok(()) +} + +/// PATCH semantics: apply exactly the fields present in `changes`. pub fn update_note(conn: &Connection, id: &str, changes: &Value) -> rusqlite::Result { let obj = changes .as_object() diff --git a/core/src/sync/push.rs b/core/src/sync/push.rs index f4ca47b..f39e7de 100644 --- a/core/src/sync/push.rs +++ b/core/src/sync/push.rs @@ -69,7 +69,6 @@ pub struct Change { #[serde(skip_serializing_if = "Option::is_none")] pub color: Option, #[serde(skip_serializing_if = "Option::is_none")] - #[serde(skip_serializing_if = "Option::is_none")] pub pinned: Option, #[serde(skip_serializing_if = "Option::is_none")] pub archived: Option, diff --git a/frontend/src/components/NoteEditor.vue b/frontend/src/components/NoteEditor.vue index 87705ca..76b4736 100644 --- a/frontend/src/components/NoteEditor.vue +++ b/frontend/src/components/NoteEditor.vue @@ -627,7 +627,6 @@ function revPreview(rev: NoteRevision): string { -
-