DSatishchandra commited on
Commit
e40b3b0
·
verified ·
1 Parent(s): f319539

Update templates/menu_page.html

Browse files
Files changed (1) hide show
  1. templates/menu_page.html +2 -2
templates/menu_page.html CHANGED
@@ -108,7 +108,7 @@
108
  fetch('/menu') // Endpoint that returns the menu data as JSON
109
  .then(response => response.json())
110
  .then(data => {
111
- menuItems = data;
112
  menuItems.forEach(item => {
113
  const menuItemDiv = document.createElement('div');
114
  menuItemDiv.classList.add('menu-item');
@@ -119,7 +119,7 @@
119
  <p>Category: ${item.category}</p>
120
  <button class="order-btn" data-item="${item.name}">Order</button>
121
  `;
122
- menuItemsContainer.appendChild(menuItemDiv);
123
  });
124
  })
125
  .catch(error => console.error('Error fetching menu items:', error));
 
108
  fetch('/menu') // Endpoint that returns the menu data as JSON
109
  .then(response => response.json())
110
  .then(data => {
111
+ menuItems = data; // Store fetched data
112
  menuItems.forEach(item => {
113
  const menuItemDiv = document.createElement('div');
114
  menuItemDiv.classList.add('menu-item');
 
119
  <p>Category: ${item.category}</p>
120
  <button class="order-btn" data-item="${item.name}">Order</button>
121
  `;
122
+ menuItemsContainer.appendChild(menuItemDiv); // Add item to the container
123
  });
124
  })
125
  .catch(error => console.error('Error fetching menu items:', error));