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

@@ -10,7 +10,8 @@
}, },
"formatter": { "formatter": {
"enabled": true, "enabled": true,
"indentStyle": "tab" "indentStyle": "space",
"indentWidth": 4
}, },
"linter": { "linter": {
"enabled": true, "enabled": true,

View File

@@ -37,7 +37,9 @@ class Flatastic {
} }
getTaskList() { 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() { getInformation() {

View File

@@ -28,8 +28,8 @@ export default function Flatastic() {
<ul> <ul>
{chores.map((chore: FlatasticChore) => ( {chores.map((chore: FlatasticChore) => (
<li key={chore.id} style={{ textAlign: "left" }}> <li key={chore.id} style={{ textAlign: "left" }}>
{idToNameMap[chore.currentUser]}: {chore.title} - Points:{" "} {idToNameMap[chore.currentUser]}: {chore.title} -
{chore.points} Points: {chore.points}
</li> </li>
))} ))}
</ul> </ul>

View File

@@ -9,21 +9,26 @@ interface FlatasticStore {
} }
const useFlatasticStore = create( const useFlatasticStore = create(
devtools((set) => ({ devtools(
(set) => ({
chores: [], chores: [],
fetch: async () => { fetch: async () => {
if (!import.meta.env.VITE_FLATTASTIC_API_KEY) { if (!import.meta.env.VITE_FLATTASTIC_API_KEY) {
throw new Error("Flatastic API Key is not set"); throw new Error("Flatastic API Key is not set");
} }
const flatastic = new Flatastic(import.meta.env.VITE_FLATTASTIC_API_KEY); const flatastic = new Flatastic(
import.meta.env.VITE_FLATTASTIC_API_KEY,
);
const data = await flatastic.getTaskList(); const data = await flatastic.getTaskList();
console.log("Flatastic chores fetched:", data); console.log("Flatastic chores fetched:", data);
set({ chores: data as FlatasticChore[] }); set({ chores: data as FlatasticChore[] });
}, },
}), {
name: "flatastic-store",
}), }),
{
name: "flatastic-store",
},
),
); );
export { useFlatasticStore }; export { useFlatasticStore };

View File

@@ -4,7 +4,8 @@ import type { DepartureType } from "@/types/departureType";
import { devtools } from "zustand/middleware"; import { devtools } from "zustand/middleware";
const useKVVStore = create( const useKVVStore = create(
devtools((set) => ({ devtools(
(set) => ({
pStreet: [] as DepartureType[], pStreet: [] as DepartureType[],
hStreet: [] as DepartureType[], hStreet: [] as DepartureType[],
fetch: async () => { fetch: async () => {
@@ -25,9 +26,11 @@ const useKVVStore = create(
pStreet: pStreetJson as DepartureType[], pStreet: pStreetJson as DepartureType[],
}); });
}, },
}), {
name: "kvv-store",
}), }),
{
name: "kvv-store",
},
),
); );
export { useKVVStore }; export { useKVVStore };