format code
This commit is contained in:
@@ -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");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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() {
|
||||
<table>
|
||||
<tbody>
|
||||
{hStreetData.map((departure, index) => (
|
||||
// biome-ignore lint/suspicious/noArrayIndexKey: there is no id
|
||||
<TimetableRow key={index} departure={departure} />
|
||||
))}
|
||||
</tbody>
|
||||
@@ -47,6 +47,7 @@ export default function Timetable() {
|
||||
<table>
|
||||
<tbody>
|
||||
{pStreetData.map((departure, index) => (
|
||||
// biome-ignore lint/suspicious/noArrayIndexKey: there is no id
|
||||
<TimetableRow key={index} departure={departure} />
|
||||
))}
|
||||
</tbody>
|
||||
|
||||
@@ -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(
|
||||
<StrictMode>
|
||||
<App />
|
||||
|
||||
@@ -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[],
|
||||
|
||||
@@ -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({
|
||||
|
||||
Reference in New Issue
Block a user