geethareddy commited on
Commit
485e0f9
·
verified ·
1 Parent(s): 747a80c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -55,7 +55,7 @@ def get_ingredients():
55
 
56
  try:
57
  # Construct the base query
58
- soql = "SELECT Name, Image_URL__c FROM Sector_Detail__c"
59
  if condition:
60
  soql += f" WHERE {condition}"
61
  soql += " LIMIT 200"
@@ -63,7 +63,7 @@ def get_ingredients():
63
  logger.info(f"Executing SOQL query: {soql}")
64
  result = sf.query(soql)
65
  ingredients = [
66
- {"name": record['Name'], "image_url": record.get('Image_URL__c', '')}
67
  for record in result['records'] if 'Name' in record
68
  ]
69
  logger.info(f"Fetched {len(ingredients)} ingredients: {ingredients}")
@@ -73,4 +73,4 @@ def get_ingredients():
73
  return jsonify({"error": f"Failed to fetch ingredients: {str(e)}"}), 500
74
 
75
  if __name__ == '__main__':
76
- app.run(debug=True, host='0.0.0.0', port=7860)
 
55
 
56
  try:
57
  # Construct the base query
58
+ soql = "SELECT Name, Image_URL__c, Description__c FROM Sector_Detail__c"
59
  if condition:
60
  soql += f" WHERE {condition}"
61
  soql += " LIMIT 200"
 
63
  logger.info(f"Executing SOQL query: {soql}")
64
  result = sf.query(soql)
65
  ingredients = [
66
+ {"name": record['Name'], "image_url": record.get('Image_URL__c', ''), "description": record.get('Description__c', 'No description available')}
67
  for record in result['records'] if 'Name' in record
68
  ]
69
  logger.info(f"Fetched {len(ingredients)} ingredients: {ingredients}")
 
73
  return jsonify({"error": f"Failed to fetch ingredients: {str(e)}"}), 500
74
 
75
  if __name__ == '__main__':
76
+ app.run(debug=True, host='0.0.0.0', port=7860)