feat(trash): NoteRepository.restore (#4 v0.2.3)
This commit is contained in:
@@ -231,6 +231,13 @@ export class NoteRepository {
|
||||
tx();
|
||||
}
|
||||
|
||||
restore(id: string): void {
|
||||
const now = new Date().toISOString();
|
||||
this.db
|
||||
.prepare(`UPDATE notes SET deleted_at = NULL, updated_at = ? WHERE id = ?`)
|
||||
.run(now, id);
|
||||
}
|
||||
|
||||
delete(id: string): void {
|
||||
this.db.prepare('DELETE FROM notes WHERE id=?').run(id);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user