Příprava Pizza Day

This commit is contained in:
2023-06-04 10:50:29 +02:00
parent 24ac5155a5
commit bae7966e5a
10 changed files with 179 additions and 104 deletions

View File

@@ -67,11 +67,9 @@ const downloadPizzy = async () => {
const sizes: PizzaSize[] = [];
const a = $('.varianty > li > a', pizzaHtml);
a.each((i, elm) => {
// TODO nedoděláno
// const size = $('span', elm).text();
// const priceKc = $(elm).text().split(size).pop().trim();
// const price = Number.parseInt(priceKc.split(" Kč")[0]);
// sizes.push({ size: size, pizzaPrice: price, boxPrice: boxPrices[size], price: price + boxPrices[size] });
const size = $($(elm).contents().get(0)).text().trim();
const price = Number.parseInt($($(elm).contents().get(1)).text().trim().split(" Kč")[0]);
sizes.push({ size: size, pizzaPrice: price, boxPrice: boxPrices[size], price: price + boxPrices[size] });
})
result.push({
name: name,