(ws: WebSocket)
| 972 | |
| 973 | // Apply the restored content |
| 974 | const restoredTitle = (this.sql.exec( |
| 975 | "SELECT title FROM note_versions WHERE id = ?", version_id |
| 976 | ).toArray()[0] as any)?.title || "Untitled"; |
| 977 | |
| 978 | this.sql.exec( |
| 979 | "UPDATE notes SET title = ?, content = ?, yjs_state = NULL, updated_at = unixepoch() WHERE id = ?", |
| 980 | restoredTitle, restoredContent, noteId |
| 981 | ); |
| 982 | |
| 983 | await this.createVersion(noteId, restoredTitle, restoredContent, "restore", "restore", "Restored version"); |
nothing calls this directly
no test coverage detected