From 401833f763e77f4fa58c9003e164349b5330bafb Mon Sep 17 00:00:00 2001 From: Martin Berka Date: Wed, 27 Sep 2023 18:34:14 +0200 Subject: [PATCH] =?UTF-8?q?Oprava=20zbyte=C4=8Dn=C3=A9ho=20pos=C3=ADl?= =?UTF-8?q?=C3=A1n=C3=AD=20loginu=20na=20server?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- client/src/Api.ts | 4 ++-- client/src/App.tsx | 4 +--- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/client/src/Api.ts b/client/src/Api.ts index d6dcfa7..8706b69 100644 --- a/client/src/Api.ts +++ b/client/src/Api.ts @@ -104,8 +104,8 @@ export const login = async (login?: string) => { return await api.post('/api/login', JSON.stringify({ login })); } -export const changeDepartureTime = async (login: string, time: string, dayIndex?: number) => { - return await api.post('/api/changeDepartureTime', JSON.stringify({ login, time, dayIndex })); +export const changeDepartureTime = async (time: string, dayIndex?: number) => { + return await api.post('/api/changeDepartureTime', JSON.stringify({ time, dayIndex })); } export const updatePizzaFee = async (login: string, text?: string, price?: number) => { diff --git a/client/src/App.tsx b/client/src/App.tsx index d5abf2b..4ba14bf 100644 --- a/client/src/App.tsx +++ b/client/src/App.tsx @@ -268,9 +268,7 @@ function App() { const handleChangeDepartureTime = async (event: React.ChangeEvent) => { if (foodChoiceList?.length && choiceRef.current?.value) { - if (auth?.login) { - await changeDepartureTime(auth.login, event.target.value, dayIndex); - } + await changeDepartureTime(event.target.value, dayIndex); } }