Spaces:
Build error
Build error
Update static/script.js
Browse files- static/script.js +1 -2
static/script.js
CHANGED
|
@@ -155,7 +155,7 @@ function displayIngredientsList(ingredients) {
|
|
| 155 |
const item = document.createElement('div');
|
| 156 |
item.className = 'ingredient-item';
|
| 157 |
const img = document.createElement('img');
|
| 158 |
-
img.src = ingredient.image_url || 'https://picsum.photos/80';
|
| 159 |
img.alt = ingredient.name;
|
| 160 |
console.log(`Setting image src for ${ingredient.name} to: ${img.src}`); // Debug log
|
| 161 |
img.style.width = '80px';
|
|
@@ -288,7 +288,6 @@ function submitIngredients() {
|
|
| 288 |
.then(response => response.json())
|
| 289 |
.then(data => {
|
| 290 |
if (data.success) {
|
| 291 |
-
// Determine category based on selected ingredients
|
| 292 |
let category = 'non-vegetarian';
|
| 293 |
if (selectedIngredients.some(ing => ing.name.toLowerCase().includes('vegetarian'))) category = 'vegetarian';
|
| 294 |
else if (selectedIngredients.some(ing => ing.name.toLowerCase().includes('chicken'))) category = 'chicken';
|
|
|
|
| 155 |
const item = document.createElement('div');
|
| 156 |
item.className = 'ingredient-item';
|
| 157 |
const img = document.createElement('img');
|
| 158 |
+
img.src = ingredient.image_url || 'https://picsum.photos/80'; // Fallback if Image1__c is empty
|
| 159 |
img.alt = ingredient.name;
|
| 160 |
console.log(`Setting image src for ${ingredient.name} to: ${img.src}`); // Debug log
|
| 161 |
img.style.width = '80px';
|
|
|
|
| 288 |
.then(response => response.json())
|
| 289 |
.then(data => {
|
| 290 |
if (data.success) {
|
|
|
|
| 291 |
let category = 'non-vegetarian';
|
| 292 |
if (selectedIngredients.some(ing => ing.name.toLowerCase().includes('vegetarian'))) category = 'vegetarian';
|
| 293 |
else if (selectedIngredients.some(ing => ing.name.toLowerCase().includes('chicken'))) category = 'chicken';
|