feat(trash): NoteRepository.restore (#4 v0.2.3)

This commit is contained in:
altair823
2026-05-01 20:42:42 +09:00
parent 13da554461
commit bf49b8351e
2 changed files with 41 additions and 0 deletions

View File

@@ -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);
}