Skip to content

Commit

Permalink
bugfix frontend filters handling
Browse files Browse the repository at this point in the history
  • Loading branch information
BuweiChen committed Apr 16, 2024
1 parent 5063f91 commit aa57a0b
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions backend/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -344,12 +344,16 @@ def chat():
) # assume it is an array of season code
filter_subjects = data.get("subject", None)
filter_areas_and_skills = data.get("areas", None)
filter_skills = [
area for area in filter_areas_and_skills if area in ["Hu", "So", "Sc"]
]
filter_areas = [
area for area in filter_areas_and_skills if area in ["QR", "WR"]
]
if filter_areas_and_skills:
filter_skills = [
area for area in filter_areas_and_skills if area in ["Hu", "So", "Sc"]
]
filter_areas = [
area for area in filter_areas_and_skills if area in ["QR", "WR"]
]
else:
filter_skills = None
filter_areas = None

if not user_messages:
return jsonify({"error": "No message provided"})
Expand Down

0 comments on commit aa57a0b

Please sign in to comment.