From d08290ce3d906de645f0189dd01cb53d20497d41 Mon Sep 17 00:00:00 2001 From: Arif Hasanic Date: Fri, 25 Jul 2025 01:10:00 +0200 Subject: [PATCH] format code --- src/api/flatastic.ts | 12 +++--------- src/components/Timetable/Timetable.tsx | 5 +++-- src/main.tsx | 1 + src/store/kvv.ts | 6 ++++++ vite.config.ts | 2 +- 5 files changed, 14 insertions(+), 12 deletions(-) diff --git a/src/api/flatastic.ts b/src/api/flatastic.ts index 0cc59ff..3d75268 100644 --- a/src/api/flatastic.ts +++ b/src/api/flatastic.ts @@ -5,7 +5,7 @@ class Flatastic { this.apikey = apikey; } - async request(url: string, option: any) { + async request(url: stringany) { const headers = { accept: "application/json, text/plain, */*", "accept-language": @@ -20,10 +20,8 @@ class Flatastic { "x-client-version": "2.3.20", }; const response = await fetch(url, { - ...option, headers: { ...headers, - ...option.headers, }, }); if (!response.ok) { @@ -35,19 +33,15 @@ class Flatastic { getShoppingList() { return this.request( "https://api.flatastic-app.com/index.php/api/shoppinglist", - {}, ); } getTaskList() { - return this.request( - "https://api.flatastic-app.com/index.php/api/chores", - {}, - ); + return this.request("https://api.flatastic-app.com/index.php/api/chores"); } getInformation() { - this.request("https://api.flatastic-app.com/index.php/api/wg", {}); + return this.request("https://api.flatastic-app.com/index.php/api/wg"); } } diff --git a/src/components/Timetable/Timetable.tsx b/src/components/Timetable/Timetable.tsx index b467c4e..99dd727 100644 --- a/src/components/Timetable/Timetable.tsx +++ b/src/components/Timetable/Timetable.tsx @@ -1,8 +1,7 @@ import { useEffect } from "react"; -import TimetableRow from "../TimetableRow/TimetableRow"; +import TimetableRow from "@/components/TimetableRow/TimetableRow"; -import _ from "lodash"; import { useKVVStore } from "@/store/kvv"; import type { DepartureType } from "@/types/departureType"; @@ -39,6 +38,7 @@ export default function Timetable() { {hStreetData.map((departure, index) => ( + // biome-ignore lint/suspicious/noArrayIndexKey: there is no id ))} @@ -47,6 +47,7 @@ export default function Timetable() {
{pStreetData.map((departure, index) => ( + // biome-ignore lint/suspicious/noArrayIndexKey: there is no id ))} diff --git a/src/main.tsx b/src/main.tsx index 6505447..48c6758 100644 --- a/src/main.tsx +++ b/src/main.tsx @@ -4,6 +4,7 @@ import { createRoot } from "react-dom/client"; import "./index.css"; import App from "./App.tsx"; +// biome-ignore lint/style/noNonNullAssertion: if the root element is not found, the app should not render createRoot(document.getElementById("root")!).render( diff --git a/src/store/kvv.ts b/src/store/kvv.ts index d8d5a01..96c04b7 100644 --- a/src/store/kvv.ts +++ b/src/store/kvv.ts @@ -14,6 +14,12 @@ const useKVVStore = create( const pStreetData = await fetchKvvDepartures(pStreetStopId); const hStreetJson = await hStreetData.json(); const pStreetJson = await pStreetData.json(); + + console.log("KVV departures fetched:", { + hStreet: hStreetJson, + pStreet: pStreetJson, + }); + set({ hStreet: hStreetJson as DepartureType[], pStreet: pStreetJson as DepartureType[], diff --git a/vite.config.ts b/vite.config.ts index 87e846b..9300e3d 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -1,6 +1,6 @@ import { defineConfig } from "vite"; import react from "@vitejs/plugin-react-swc"; -import path from "path"; +import path from "node:path"; // https://vite.dev/config/ export default defineConfig({