feat: expose trash in gui
This commit is contained in:
@@ -186,6 +186,19 @@ func (r *Repository) ListInboxRoots(includeDeleted bool) ([]Node, error) {
|
||||
return scanNodes(rows)
|
||||
}
|
||||
|
||||
// ListDeleted returns soft-deleted nodes, newest deleted first.
|
||||
func (r *Repository) ListDeleted() ([]Node, error) {
|
||||
rows, err := r.db.Query(
|
||||
`SELECT ` + nodeColumns + ` FROM nodes
|
||||
WHERE deleted_at IS NOT NULL
|
||||
ORDER BY deleted_at DESC, updated_at DESC, title`)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
defer rows.Close()
|
||||
return scanNodes(rows)
|
||||
}
|
||||
|
||||
// CountChildren returns the number of non-deleted children for a parent,
|
||||
// optionally filtered by one or more types.
|
||||
func (r *Repository) CountChildren(parentID string, types ...string) (int, error) {
|
||||
|
||||
Reference in New Issue
Block a user