Začištění kódu

This commit is contained in:
Martin Berka 2023-08-08 21:45:21 +02:00
parent d41e0e9113
commit e78f9cfd3a
2 changed files with 4 additions and 7 deletions

View File

@ -5,7 +5,6 @@ import cors from 'cors';
import { addChoice, addPizzaOrder, createPizzaDay, deletePizzaDay, finishPizzaDelivery, finishPizzaOrder, getData, getPizzaList, getRestaurantMenu, lockPizzaDay, removeChoice, removeChoices, removePizzaOrder, savePizzaList, unlockPizzaDay, updateDepartureTime, updateNote } from "./service";
import dotenv from 'dotenv';
import path from 'path';
import { getMenuSladovnicka, getMenuTechTower, getMenuUMotliku } from "./restaurants";
import { getQr } from "./qr";
import { generateToken, getLogin, getTrusted, verify } from "./auth";
import { Food, Locations, Restaurants } from "../../types";

View File

@ -68,12 +68,10 @@ export async function getRestaurantMenu(restaurant: Restaurants, date?: Date, mo
storage.setData(today, clientData);
}
if (!clientData?.menus?.[restaurant]) {
if (!clientData.menus[restaurant]) {
clientData.menus[restaurant] = {
lastUpdate: getHumanTime(new Date()),
food: [],
};
}
switch (restaurant) {
case Restaurants.SLADOVNICKA:
clientData.menus[restaurant].food = await getMenuSladovnicka(date, mock);