fixed filter override for archived
This commit is contained in:
@ -491,7 +491,14 @@ impl<'a> Compiler<'a> {
|
|||||||
.unwrap_or_else(|| base_alias.clone());
|
.unwrap_or_else(|| base_alias.clone());
|
||||||
|
|
||||||
let mut where_clauses = Vec::new();
|
let mut where_clauses = Vec::new();
|
||||||
where_clauses.push(format!("NOT {}.archived", entity_alias));
|
|
||||||
|
// Dynamically apply the 'active-only' default ONLY if the client
|
||||||
|
// didn't explicitly request to filter on 'archived' themselves!
|
||||||
|
let has_archived_override = self.filter_keys.iter().any(|k| k == "archived");
|
||||||
|
|
||||||
|
if !has_archived_override {
|
||||||
|
where_clauses.push(format!("NOT {}.archived", entity_alias));
|
||||||
|
}
|
||||||
|
|
||||||
self.compile_filter_conditions(r#type, type_aliases, &node, &base_alias, &mut where_clauses);
|
self.compile_filter_conditions(r#type, type_aliases, &node, &base_alias, &mut where_clauses);
|
||||||
self.compile_relation_conditions(
|
self.compile_relation_conditions(
|
||||||
|
|||||||
Reference in New Issue
Block a user