Oprava stahování pizz pro Pizza day

This commit is contained in:
2023-08-10 21:47:56 +02:00
parent e78f9cfd3a
commit 45bd84f96f
3 changed files with 11 additions and 4 deletions

View File

@@ -152,8 +152,7 @@ app.post("/api/addPizza", async (req, res) => {
const pizzaSizeIndex = req.body.pizzaSizeIndex;
let pizzy = await getPizzaList();
if (!pizzy) {
pizzy = await downloadPizzy();
savePizzaList(pizzy);
throw Error("Selhalo získání seznamu dostupných pizz.");
}
if (!pizzy[pizzaIndex]) {
throw Error("Neplatný index pizzy: " + pizzaIndex);