change food item type

This commit is contained in:
hamid zarghami
2026-06-03 14:59:47 +03:30
parent ce1a4ea7a8
commit b9608cd486
8 changed files with 316 additions and 312 deletions
+4 -7
View File
@@ -121,8 +121,8 @@ const MenuIndex = () => {
const selectedCatId = selectedCategory === '0' ? null : selectedCategory;
const filtered = foods.filter((item) => {
const matchesCategory = !selectedCatId || item.category?.id === selectedCatId;
const itemName = item.name || item.title || item.foodName || "";
const matchesCategory = !selectedCatId || item.category === selectedCatId;
const itemName = item.title;
const matchesSearch =
!search || itemName.toLowerCase().includes(lowerSearch);
@@ -134,9 +134,7 @@ const MenuIndex = () => {
content.toLowerCase().includes(lowerIngredients)
);
}
// اگر محتویات وجود نداشت یا خالی بود، در توضیحات جستجو می‌کنیم
const description = item.description || item.desc || "";
return description.toLowerCase().includes(lowerIngredients);
return item.desc.toLowerCase().includes(lowerIngredients);
})();
const matchesDelivery = selectedDeliveryId === "0" ||
@@ -151,9 +149,8 @@ const MenuIndex = () => {
return [...filtered].sort((a, b) => {
switch (sortingKey) {
case "PopularityDescending":
return (b.points ?? 0) - (a.points ?? 0);
case "RateDescending":
return (b.rate ?? 0) - (a.rate ?? 0);
return 0;
case "PriceAscending":
return (a.price ?? 0) - (b.price ?? 0);
case "PriceDescending":