Skip to content

Commit d56610c

Browse files
committed
Improve search
1 parent 18064f4 commit d56610c

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

page/script.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -290,12 +290,15 @@ function search() {
290290

291291
let match = false;
292292
if (recipe.title.toLowerCase().includes(query.toLowerCase())) match = true;
293+
for (const mealType of recipe.mealType) {
294+
if (mealType.toLowerCase().includes(query.toLowerCase())) match = true;
295+
};
293296
for (const ingredient of recipe.ingredients) {
294297
if (ingredient.toLowerCase().includes(query.toLowerCase())) match = true;
295-
}
298+
};
296299
for (const instruction of recipe.instructions) {
297300
if (instruction.toLowerCase().includes(query.toLowerCase())) match = true;
298-
}
301+
};
299302

300303
if (match) {
301304
let dietaryRestrictions = [];

0 commit comments

Comments
 (0)