Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -38,12 +38,12 @@ def get_ingredients():
|
|
38 |
dietary_preference = request.json.get('dietary_preference', '').strip().lower()
|
39 |
logging.debug(f"Received dietary preference: {dietary_preference}")
|
40 |
|
41 |
-
|
42 |
-
|
43 |
-
soql = "SELECT Name, Image_URL__c FROM Sector_Detail__c WHERE Category__c
|
44 |
-
elif dietary_preference == '
|
45 |
-
|
46 |
-
soql = "SELECT Name, Image_URL__c FROM Sector_Detail__c WHERE Category__c
|
47 |
else:
|
48 |
logging.debug("Invalid dietary preference received.")
|
49 |
return jsonify({"error": "Invalid dietary preference."}), 400
|
|
|
38 |
dietary_preference = request.json.get('dietary_preference', '').strip().lower()
|
39 |
logging.debug(f"Received dietary preference: {dietary_preference}")
|
40 |
|
41 |
+
if dietary_preference == 'veg':
|
42 |
+
print("Fetching ingredients for Vegetarian...") # Debug when fetching vegetarian ingredients
|
43 |
+
soql = "SELECT Name, Image_URL__c FROM Sector_Detail__c WHERE Category__c IN ('Veg') LIMIT 200"
|
44 |
+
elif dietary_preference == 'non-vegetarian':
|
45 |
+
print("Fetching ingredients for Non-Vegetarian...") # Debug when fetching non-vegetarian ingredients
|
46 |
+
soql = "SELECT Name, Image_URL__c FROM Sector_Detail__c WHERE Category__c IN ('Non-Veg') LIMIT 200"
|
47 |
else:
|
48 |
logging.debug("Invalid dietary preference received.")
|
49 |
return jsonify({"error": "Invalid dietary preference."}), 400
|