diff --git a/client/src/App.tsx b/client/src/App.tsx
index 1bb8b7f..8bbafa4 100644
--- a/client/src/App.tsx
+++ b/client/src/App.tsx
@@ -68,11 +68,11 @@ function App() {
if (!auth?.login) {
return
}
- getData().then(({ data }) => {
+ getData().then(data => {
if (data) {
setData(data);
- setDayIndex(data.weekIndex);
- dayIndexRef.current = data.weekIndex;
+ setDayIndex(data.dayIndex);
+ dayIndexRef.current = data.dayIndex;
setFood(data.menus);
}
}).catch(e => {
@@ -363,7 +363,7 @@ function App() {
content =
Chyba načtení dat
}
return
- doAddClickFoodChoice(location)}>{location}
+ doAddClickFoodChoice(location)}>{LunchChoice[location]}
{menu?.lastUpdate && Poslední aktualizace: {getHumanDateTime(new Date(menu.lastUpdate))}}
{content}
@@ -651,7 +651,7 @@ function App() {
}
- >}
+ > || "Jejda, něco se nám nepovedlo :("}
setNoteModalOpen(false)} onSave={saveNote} />
diff --git a/client/src/api/Api.ts b/client/src/api/Api.ts
index a8666b6..0bed18f 100644
--- a/client/src/api/Api.ts
+++ b/client/src/api/Api.ts
@@ -1,5 +1,6 @@
import { toast } from "react-toastify";
import { getToken } from "../Utils";
+import { ClientData } from "../../../types";
/**
* Wrapper pro volání API, u kterých chceme automaticky zobrazit toaster s chybou ze serveru.
@@ -70,7 +71,7 @@ export const getQrUrl = (login: string) => {
return `/api/qr?login=${login}`;
}
-export const getData = async (dayIndex?: number) => {
+export const getData = async (dayIndex?: number): Promise => {
let url = '/api/data';
if (dayIndex != null) {
url += '?dayIndex=' + dayIndex;
diff --git a/client/src/api/Client.ts b/client/src/api/Client.ts
deleted file mode 100644
index 2c5d5c6..0000000
--- a/client/src/api/Client.ts
+++ /dev/null
@@ -1,8 +0,0 @@
-import { client } from '../../../types/gen/client.gen';
-import { getToken } from '../Utils';
-
-client.setConfig({
- auth: () => getToken(),
-});
-
-export default client
\ No newline at end of file
diff --git a/types/openapi-ts.config.ts b/types/openapi-ts.config.ts
index b63c998..82bc237 100644
--- a/types/openapi-ts.config.ts
+++ b/types/openapi-ts.config.ts
@@ -1,11 +1,11 @@
-import { defaultPlugins } from '@hey-api/openapi-ts';
+// import { defaultPlugins } from '@hey-api/openapi-ts';
export default {
input: 'api.yml',
output: 'gen',
plugins: [
- ...defaultPlugins,
- '@hey-api/client-fetch',
+ // ...defaultPlugins,
+ // '@hey-api/client-fetch',
{
enums: 'javascript',
name: '@hey-api/typescript',