Proyectos de Subversion LeadersLinked - SPA

Rev

Rev 3486 | Rev 3494 | Ir a la última revisión | Mostrar el archivo completo | | | Autoría | Ultima modificación | Ver Log |

Rev 3486 Rev 3487
Línea 7... Línea 7...
7
};
7
};
Línea 8... Línea 8...
8
 
8
 
9
export function useFetch(url) {
9
export function useFetch(url) {
Línea 10... Línea 10...
10
  const { showError } = useAlert();
10
  const { showError } = useAlert();
11
 
11
 
12
  const { data, loading, execute } = useApi(getResources, {
12
  const { loading, data, execute } = useApi(getResources, {
13
    autoFetch: true,
13
    autofetch: true,
14
    autofetchDependencies: [url],
14
    autofetchDependencies: [url],
-
 
15
    initialArgs: [url],
-
 
16
    onSuccess: (userData) => {
15
    initialArgs: [url],
17
      console.log('User data fetched successfully:', userData);
-
 
18
    },
-
 
19
    onError: (err) => {
-
 
20
      console.error('Failed to fetch user data:', err);
16
    onSuccess: (response) => console.log({ response }),
21
      showError(err.message);
Línea 17... Línea 22...
17
    onError: (error) => showError(error)
22
    }
18
  });
23
  });
19
 
24