Vylepšená detekce uzavření podniků
This commit is contained in:
parent
eb27591727
commit
8d80678a9a
@ -356,6 +356,7 @@ function App() {
|
||||
<li>Serverová validace času odchodu</li>
|
||||
<li>Loader při zakládání Pizza day</li>
|
||||
<li>Možnost ručního zadání příplatku k Pizza day objednávkám</li>
|
||||
<li>Vylepšená detekce uzavření pro podniky Sladovnická a TechTower</li>
|
||||
</ul>
|
||||
</Alert>
|
||||
{dayIndex != null &&
|
||||
|
@ -82,7 +82,12 @@ export async function getRestaurantMenu(restaurant: Restaurants, date?: Date): P
|
||||
const mock = process.env.MOCK_DATA === 'true';
|
||||
switch (restaurant) {
|
||||
case Restaurants.SLADOVNICKA:
|
||||
clientData.menus[restaurant]!.food = await getMenuSladovnicka(date, mock);
|
||||
const sladovnickaFood = await getMenuSladovnicka(date, mock);
|
||||
clientData.menus[restaurant]!.food = sladovnickaFood;
|
||||
// Velice chatrný a nespolehlivý způsob detekce uzavření...
|
||||
if (sladovnickaFood.length === 1 && sladovnickaFood[0].name.toLowerCase() === 'pro daný den nebyla nalezena denní nabídka') {
|
||||
clientData.menus[restaurant]!.closed = true;
|
||||
}
|
||||
break;
|
||||
case Restaurants.UMOTLIKU:
|
||||
const uMotlikuFood = await getMenuUMotliku(date, mock);
|
||||
@ -92,7 +97,11 @@ export async function getRestaurantMenu(restaurant: Restaurants, date?: Date): P
|
||||
}
|
||||
break;
|
||||
case Restaurants.TECHTOWER:
|
||||
clientData.menus[restaurant]!.food = await getMenuTechTower(date, mock);
|
||||
const techTowerFood = await getMenuTechTower(date, mock);
|
||||
clientData.menus[restaurant]!.food = techTowerFood;
|
||||
if (techTowerFood.length === 1 && techTowerFood[0].name.toLowerCase() === 'svátek') {
|
||||
clientData.menus[restaurant]!.closed = true;
|
||||
}
|
||||
break;
|
||||
}
|
||||
storage.setData(selectedDay, clientData);
|
||||
|
Loading…
x
Reference in New Issue
Block a user