INNER CODE UNIT · Python
get_filter_config
GifariKemal/xaubot-ai · web-dashboard/api/main.py:422
async def get_filter_config():
"""Get current filter enable/disable states."""
try:
if not FILTER_CONFIG_FILE.exists():
return {"filters": {}, "metadata": {}}
with open(FILTER_CONFIG_FILE, 'r', encoding='utf-8') as f:
data = json.load(f)
return data
except Exception as e:
logger.error(f"Failed to load filter config: {e}")
return {"filters": {}, "metadata": {}, "error": str(e)}
@app.post("/api/filters/config")
async def update_filter_config(updates: dict):