DSatishchandra commited on
Commit
09fc0b8
·
verified ·
1 Parent(s): 7547860

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -7
app.py CHANGED
@@ -82,7 +82,7 @@ try:
82
  except Exception as e:
83
  print(f"Failed to connect to Salesforce: {str(e)}")
84
 
85
- # Function to fetch menu items from Salesforce
86
  def get_menu_items():
87
  query = "SELECT Name, Price__c, Ingredients__c, Category__c FROM Menu_Item__c"
88
  result = sf.query(query)
@@ -111,7 +111,6 @@ def login():
111
  })
112
  return jsonify({'success': True, 'id': customer_login['id']}), 200
113
  return redirect("/menu") # Redirect to the menu page after successful login
114
- return render_template("login.html") # Render the login page for GET requests
115
  except Exception as e:
116
  return jsonify({'error': f'Failed to create record in Salesforce: {str(e)}'}), 500
117
 
@@ -142,11 +141,6 @@ def submit():
142
  return jsonify({'error': str(e)}), 500
143
 
144
 
145
- @app.route("/")
146
- def index():
147
- return render_template("index.html")
148
-
149
- # Route for the menu page
150
  @app.route("/menu", methods=["GET"])
151
  def menu_page():
152
  menu_items = get_menu_items() # Fetch menu items from Salesforce
 
82
  except Exception as e:
83
  print(f"Failed to connect to Salesforce: {str(e)}")
84
 
85
+ # Function to fetch menu items from Salesforce
86
  def get_menu_items():
87
  query = "SELECT Name, Price__c, Ingredients__c, Category__c FROM Menu_Item__c"
88
  result = sf.query(query)
 
111
  })
112
  return jsonify({'success': True, 'id': customer_login['id']}), 200
113
  return redirect("/menu") # Redirect to the menu page after successful login
 
114
  except Exception as e:
115
  return jsonify({'error': f'Failed to create record in Salesforce: {str(e)}'}), 500
116
 
 
141
  return jsonify({'error': str(e)}), 500
142
 
143
 
 
 
 
 
 
144
  @app.route("/menu", methods=["GET"])
145
  def menu_page():
146
  menu_items = get_menu_items() # Fetch menu items from Salesforce