fix space indentation

This commit is contained in:
Arif Hasanic
2025-07-25 11:27:09 +02:00
parent b2e9c1f056
commit 53da0f740c
21 changed files with 452 additions and 441 deletions

View File

@@ -4,26 +4,31 @@ import type { FlatasticChore } from "@/types/flatasticChore";
import { devtools } from "zustand/middleware";
interface FlatasticStore {
chores: FlatasticChore[];
fetch: () => Promise<void>;
chores: FlatasticChore[];
fetch: () => Promise<void>;
}
const useFlatasticStore = create(
devtools((set) => ({
chores: [],
fetch: async () => {
if (!import.meta.env.VITE_FLATTASTIC_API_KEY) {
throw new Error("Flatastic API Key is not set");
}
const flatastic = new Flatastic(import.meta.env.VITE_FLATTASTIC_API_KEY);
const data = await flatastic.getTaskList();
devtools(
(set) => ({
chores: [],
fetch: async () => {
if (!import.meta.env.VITE_FLATTASTIC_API_KEY) {
throw new Error("Flatastic API Key is not set");
}
const flatastic = new Flatastic(
import.meta.env.VITE_FLATTASTIC_API_KEY,
);
const data = await flatastic.getTaskList();
console.log("Flatastic chores fetched:", data);
set({ chores: data as FlatasticChore[] });
},
}), {
name: "flatastic-store",
}),
console.log("Flatastic chores fetched:", data);
set({ chores: data as FlatasticChore[] });
},
}),
{
name: "flatastic-store",
},
),
);
export { useFlatasticStore };

View File

@@ -4,30 +4,33 @@ import type { DepartureType } from "@/types/departureType";
import { devtools } from "zustand/middleware";
const useKVVStore = create(
devtools((set) => ({
pStreet: [] as DepartureType[],
hStreet: [] as DepartureType[],
fetch: async () => {
const hStreetStopId = 7000044;
const pStreetStopId = 7000045;
const hStreetData = await fetchKvvDepartures(hStreetStopId);
const pStreetData = await fetchKvvDepartures(pStreetStopId);
const hStreetJson = await hStreetData.json();
const pStreetJson = await pStreetData.json();
devtools(
(set) => ({
pStreet: [] as DepartureType[],
hStreet: [] as DepartureType[],
fetch: async () => {
const hStreetStopId = 7000044;
const pStreetStopId = 7000045;
const hStreetData = await fetchKvvDepartures(hStreetStopId);
const pStreetData = await fetchKvvDepartures(pStreetStopId);
const hStreetJson = await hStreetData.json();
const pStreetJson = await pStreetData.json();
console.log("KVV departures fetched:", {
hStreet: hStreetJson,
pStreet: pStreetJson,
});
console.log("KVV departures fetched:", {
hStreet: hStreetJson,
pStreet: pStreetJson,
});
set({
hStreet: hStreetJson as DepartureType[],
pStreet: pStreetJson as DepartureType[],
});
},
}), {
name: "kvv-store",
}),
set({
hStreet: hStreetJson as DepartureType[],
pStreet: pStreetJson as DepartureType[],
});
},
}),
{
name: "kvv-store",
},
),
);
export { useKVVStore };