From 4d2ec529bb4a1edffb6785def35f68ed16ff152c Mon Sep 17 00:00:00 2001 From: Martin Berka Date: Tue, 7 Jan 2025 15:44:39 +0100 Subject: [PATCH] =?UTF-8?q?Skryt=C3=AD=20podniku=20U=20Motl=C3=ADk=C5=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- client/src/App.tsx | 10 ++++------ server/src/service.ts | 28 ++++++++++++++-------------- types/Types.ts | 4 ++-- 3 files changed, 20 insertions(+), 22 deletions(-) diff --git a/client/src/App.tsx b/client/src/App.tsx index 48fd251..f005eb8 100644 --- a/client/src/App.tsx +++ b/client/src/App.tsx @@ -355,7 +355,7 @@ function App() { } else { content =

Chyba načtení dat

} - return + return

{name}

{menu?.lastUpdate && Poslední aktualizace: {getHumanDateTime(new Date(menu.lastUpdate))}} {content} @@ -403,12 +403,10 @@ function App() { {data.isWeekend ?

Užívejte víkend :)

: <> - + Poslední změny: {dayIndex != null && @@ -420,7 +418,7 @@ function App() { } {food[Restaurants.SLADOVNICKA] && renderFoodTable('Sladovnická', food[Restaurants.SLADOVNICKA])} - {food[Restaurants.UMOTLIKU] && renderFoodTable('U Motlíků', food[Restaurants.UMOTLIKU])} + {/* {food[Restaurants.UMOTLIKU] && renderFoodTable('U Motlíků', food[Restaurants.UMOTLIKU])} */} {food[Restaurants.TECHTOWER] && renderFoodTable('TechTower', food[Restaurants.TECHTOWER])}
diff --git a/server/src/service.ts b/server/src/service.ts index 1f6ffe6..57ef4c7 100644 --- a/server/src/service.ts +++ b/server/src/service.ts @@ -59,7 +59,7 @@ export async function getData(date?: Date): Promise { let clientData: ClientData = { ...data }; clientData.menus = { [Restaurants.SLADOVNICKA]: await getRestaurantMenu(Restaurants.SLADOVNICKA, date), - [Restaurants.UMOTLIKU]: await getRestaurantMenu(Restaurants.UMOTLIKU, date), + // [Restaurants.UMOTLIKU]: await getRestaurantMenu(Restaurants.UMOTLIKU, date), [Restaurants.TECHTOWER]: await getRestaurantMenu(Restaurants.TECHTOWER, date), } clientData = await addVolatileData(clientData); @@ -142,19 +142,19 @@ export async function getRestaurantMenu(restaurant: Restaurants, date?: Date): P console.error("Selhalo načtení jídel pro podnik Sladovnická", e); } break; - case Restaurants.UMOTLIKU: - try { - const uMotlikuFood = await getMenuUMotliku(firstDay, mock); - for (let i = 0; i < uMotlikuFood.length; i++) { - menus[i][restaurant]!.food = uMotlikuFood[i]; - if (uMotlikuFood[i].length === 1 && uMotlikuFood[i][0].name.toLowerCase() === 'zavřeno') { - menus[i][restaurant]!.closed = true; - } - } - } catch (e: any) { - console.error("Selhalo načtení jídel pro podnik U Motlíků", e); - } - break; + // case Restaurants.UMOTLIKU: + // try { + // const uMotlikuFood = await getMenuUMotliku(firstDay, mock); + // for (let i = 0; i < uMotlikuFood.length; i++) { + // menus[i][restaurant]!.food = uMotlikuFood[i]; + // if (uMotlikuFood[i].length === 1 && uMotlikuFood[i][0].name.toLowerCase() === 'zavřeno') { + // menus[i][restaurant]!.closed = true; + // } + // } + // } catch (e: any) { + // console.error("Selhalo načtení jídel pro podnik U Motlíků", e); + // } + // break; case Restaurants.TECHTOWER: try { const techTowerFood = await getMenuTechTower(firstDay, mock); diff --git a/types/Types.ts b/types/Types.ts index cf1294e..88f9015 100644 --- a/types/Types.ts +++ b/types/Types.ts @@ -1,7 +1,7 @@ /** Výčtový typ pro restaurace, pro které umíme získat a parsovat obědové menu. */ export enum Restaurants { SLADOVNICKA = 'sladovnicka', - UMOTLIKU = 'uMotliku', + // UMOTLIKU = 'uMotliku', TECHTOWER = 'techTower', } @@ -110,7 +110,7 @@ export interface Food { // TODO tohle je dost špatné pojmenování, vzhledem k tomu co to obsahuje export enum Locations { SLADOVNICKA = 'Sladovnická', - UMOTLIKU = 'U Motlíků', + // UMOTLIKU = 'U Motlíků', TECHTOWER = 'TechTower', SPSE = 'SPŠE', PIZZA = 'Pizza day',