debugging fetch on budget screen

This commit is contained in:
Thomas Schleicher 2024-01-02 08:48:50 +01:00 committed by Jakob Stornig
parent 8931386239
commit 85c737e66c
3 changed files with 35 additions and 32 deletions

View file

@ -8,7 +8,6 @@ const useFetch = (query: Query) => {
const [data, setData] = useState<{[column: string]: any;}[]>([]);
const reFetch = () => {
setIsLoading(true);
executeQuery(query).then((result) => {
if("rows" in result[0]) {
@ -16,7 +15,7 @@ const useFetch = (query: Query) => {
}
}).catch((error: any) => {
console.error("Fetching data from database has failed: ", error);
}).finally(() => {
}).then(() => {
setIsLoading(false);
});
}