fix: restrict inbox to captured artifacts
This commit is contained in:
@@ -169,10 +169,13 @@ func (r *Repository) ListRoots(includeDeleted bool) ([]Node, error) {
|
||||
return scanNodes(rows)
|
||||
}
|
||||
|
||||
// ListInboxRoots returns active root nodes that are not assigned to a specific section.
|
||||
// ListInboxRoots returns active root capture artifacts explicitly marked for inbox.
|
||||
func (r *Repository) ListInboxRoots(includeDeleted bool) ([]Node, error) {
|
||||
q := `SELECT ` + nodeColumns + ` FROM nodes
|
||||
WHERE parent_id IS NULL AND COALESCE(section, '') IN ('', 'inbox')`
|
||||
WHERE parent_id IS NULL
|
||||
AND id IN (
|
||||
SELECT node_id FROM node_meta WHERE key = 'capture.inbox' AND value = 'true'
|
||||
)`
|
||||
if !includeDeleted {
|
||||
q += " AND deleted_at IS NULL"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user