'How to display another field from firebase
So, this might be an easy question, but I am currently displaying food items from my firebase database with items that have corresponding "Category". I want to display all items that have a field in the database that have "All_Day_Special : true" in the "All Day Special" category on my website.
Here is my code so far.
const filterItems = items?.filter(item => {
switch (activeCategory) {
case 'all':
return true
case 'appetizers':
break
case 'addIns':
break
case 'beef':
case 'chicken':
case 'chowMein':
case 'combinations':
case 'deepFriedGoodiness':
case 'dessert':
case 'flavor':
case 'friedRice':
case 'hot':
case 'pork':
case 'seafoodPlatter':
case 'sides':
case 'vegetable':
case 'whatsCooking':
case 'wing':
return item.category === activeCategory
default:
return true
}
});
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|

