Yaswanth56 commited on
Commit
57620a4
·
verified ·
1 Parent(s): 7c91f9b

Update static/script.js

Browse files
Files changed (1) hide show
  1. static/script.js +5 -2
static/script.js CHANGED
@@ -53,11 +53,14 @@ function handleResponse(userInput) {
53
  botResponse = 'Great choice! 🍽️ Here are some vegetarian ingredients:';
54
  fetchIngredients('vegetable');
55
  return;
56
- } else if (lastMessage.includes('Non-Veg')) {
57
  conversation.push({ role: 'user', message: 'Non-Vegetarian' });
58
  console.log("Food preference selected: Non-Vegetarian");
59
  botResponse = 'Great choice! 🍽️ Here are some non-vegetarian ingredients:';
60
- fetchIngredients('Non-Veg');
 
 
 
61
  return;
62
  } else if (lastMessage.includes('yes') && selectedMenuItem) {
63
  botResponse = 'Here are some ingredients to customize your dish:';
 
53
  botResponse = 'Great choice! 🍽️ Here are some vegetarian ingredients:';
54
  fetchIngredients('vegetable');
55
  return;
56
+ } else if (lastMessage.includes('non-vegetarian')) {
57
  conversation.push({ role: 'user', message: 'Non-Vegetarian' });
58
  console.log("Food preference selected: Non-Vegetarian");
59
  botResponse = 'Great choice! 🍽️ Here are some non-vegetarian ingredients:';
60
+ fetchIngredients('non-vegetarian');
61
+ return;
62
+ } else if (selectedIngredients.length > 0) {
63
+ fetchMenuItemsByIngredients();
64
  return;
65
  } else if (lastMessage.includes('yes') && selectedMenuItem) {
66
  botResponse = 'Here are some ingredients to customize your dish:';