fix space indentation
This commit is contained in:
@@ -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 };
|
||||
|
||||
Reference in New Issue
Block a user