From 160f3bf7f060bfc06df2787f0cc4b3e9c50c6c40 Mon Sep 17 00:00:00 2001 From: Martin Berka Date: Mon, 26 Jun 2023 19:56:57 +0200 Subject: [PATCH] =?UTF-8?q?P=C5=99enos=20zm=C4=9Bn?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- client/src/Api.ts | 4 ---- client/src/App.tsx | 6 ++++-- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/client/src/Api.ts b/client/src/Api.ts index d3d10d3..7ebab18 100644 --- a/client/src/Api.ts +++ b/client/src/Api.ts @@ -72,8 +72,4 @@ export const removePizza = async (login: string, pizzaOrder: PizzaOrder) => { export const updateNote = async (login: string, note?: string) => { return await api.post('/api/updateNote', JSON.stringify({ login, note })); -} - -export const updateFoodChoice = async (login: string, choice: Locations, foodName?: string) => { - return await api.post('/api/updateFoodChoice', JSON.stringify({ login, choice, foodName })); } \ No newline at end of file diff --git a/client/src/App.tsx b/client/src/App.tsx index 18ecf1d..5cef074 100644 --- a/client/src/App.tsx +++ b/client/src/App.tsx @@ -1,10 +1,10 @@ import React, { useContext, useEffect, useMemo, useRef, useState } from 'react'; import 'bootstrap/dist/css/bootstrap.min.css'; import { EVENT_DISCONNECT, EVENT_MESSAGE, SocketContext } from './context/socket'; -import { addPizza, createPizzaDay, deletePizzaDay, finishDelivery, finishOrder, getData, getFood, getPizzy, getQrUrl, lockPizzaDay, removePizza, unlockPizzaDay, updateChoice, updateFoodChoice, updateNote } from './Api'; +import { addPizza, createPizzaDay, deletePizzaDay, finishDelivery, finishOrder, getData, getFood, getPizzy, getQrUrl, lockPizzaDay, removePizza, unlockPizzaDay, updateChoice, updateFoodChoice, updateFoodChoice, updateNote } from './Api'; import { useAuth } from './context/auth'; import Login from './Login'; -import { Locations, ClientData, Pizza, PizzaOrder, State, Order, Food, Restaurants, FoodChoice } from './Types'; +import { Locations, ClientData, Pizza, PizzaOrder, State, Order, Food, Restaurants, FoodChoice, FoodChoice } from './Types'; import { Alert, Button, Col, Form, Row, Table } from 'react-bootstrap'; import Header from './components/Header'; import { FontAwesomeIcon } from '@fortawesome/react-fontawesome' @@ -32,6 +32,8 @@ function App() { const poznamkaRef = useRef(null); const [foodSelection, setFoodSelection] = useState(); const foodChoiceRef = useRef(null); + const [foodSelection, setFoodSelection] = useState(); + const foodChoiceRef = useRef(null); // Prvotní načtení aktuálního stavu useEffect(() => {