refactor: improve API wording & cleanup code

This commit is contained in:
2026-02-24 15:55:56 +00:00
parent ce0aa6bc43
commit 6695d3d272
2 changed files with 12 additions and 15 deletions

View File

@@ -126,8 +126,8 @@ def get_interaction_analysis():
print(traceback.format_exc())
return jsonify({"error": f"An unexpected error occurred: {str(e)}"}), 500
@app.route('/filter/search', methods=["POST"])
def search_dataset():
@app.route('/filter/query', methods=["POST"])
def filter_query():
if stat_obj is None:
return jsonify({"error": "No data uploaded"}), 400
@@ -137,7 +137,7 @@ def search_dataset():
return jsonify(stat_obj.df.to_dict(orient="records")), 200
query = data["query"]
filtered_df = stat_obj.search(query)
filtered_df = stat_obj.filter_by_query(query)
return jsonify(filtered_df), 200