INNER CODE UNIT · Python
update_filter_config
GifariKemal/xaubot-ai · web-dashboard/api/main.py:439
async def update_filter_config(updates: dict):
"""
Update filter enable/disable states.
Body: { "filter_key": true/false, ... }
Example: { "h1_bias": false, "ml_confidence": true }
"""
try:
# Load current config
if not FILTER_CONFIG_FILE.exists():
return {"success": False, "error": "Filter config file not found"}
with open(FILTER_CONFIG_FILE, 'r', encoding='utf-8') as f:
data = json.load(f)
# Update enabled states
for filter_key, enabled in updates.items():
if filter_key in data["filters"]: