Spaces:
				
			
			
	
			
			
		Runtime error
		
	
	
	
			
			
	
	
	
	
		
		
		Runtime error
		
	Update app.py
Browse files
    	
        app.py
    CHANGED
    
    | @@ -497,25 +497,12 @@ def remove_cart_item(item_name): | |
| 497 | 
             
                    print(f"Error: {str(e)}")
         | 
| 498 | 
             
                    return jsonify({'success': False, 'message': f"An error occurred: {str(e)}"}), 500
         | 
| 499 |  | 
| 500 | 
            -
            import logging
         | 
| 501 | 
            -
             | 
| 502 | 
            -
            # Set up logging to the console
         | 
| 503 | 
            -
            logging.basicConfig(level=logging.DEBUG)  # You can change the level to INFO, WARNING, ERROR as needed
         | 
| 504 |  | 
| 505 | 
             
            @app.route('/api/addons', methods=['GET'])
         | 
| 506 | 
             
            def get_addons():
         | 
| 507 | 
            -
                # Fetch the requested item name, category, and section
         | 
| 508 | 
            -
                item_name = request.args.get('item_name')  
         | 
| 509 | 
            -
                category = request.args.get('category')    
         | 
| 510 | 
            -
                section = request.args.get('section')      
         | 
| 511 | 
            -
             | 
| 512 | 
            -
                # Log the incoming parameters for debugging
         | 
| 513 | 
            -
                logging.debug(f"Item Name: {item_name}, Category: {category}, Section: {section}")
         | 
| 514 | 
            -
             | 
| 515 | 
             
                item_name = request.args.get('item_name')  # Fetch the requested item name
         | 
| 516 | 
             
                if not item_name:
         | 
| 517 | 
             
                    return jsonify({"success": False, "error": "Item name is required."})
         | 
| 518 | 
            -
             | 
| 519 | 
             
                try:
         | 
| 520 | 
             
                    # Fetch add-ons related to the item (update query as needed)
         | 
| 521 | 
             
                    query = f"""
         | 
|  | |
| 497 | 
             
                    print(f"Error: {str(e)}")
         | 
| 498 | 
             
                    return jsonify({'success': False, 'message': f"An error occurred: {str(e)}"}), 500
         | 
| 499 |  | 
|  | |
|  | |
|  | |
|  | |
| 500 |  | 
| 501 | 
             
            @app.route('/api/addons', methods=['GET'])
         | 
| 502 | 
             
            def get_addons():
         | 
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
| 503 | 
             
                item_name = request.args.get('item_name')  # Fetch the requested item name
         | 
| 504 | 
             
                if not item_name:
         | 
| 505 | 
             
                    return jsonify({"success": False, "error": "Item name is required."})
         | 
|  | |
| 506 | 
             
                try:
         | 
| 507 | 
             
                    # Fetch add-ons related to the item (update query as needed)
         | 
| 508 | 
             
                    query = f"""
         |