Proyectos de Subversion LeadersLinked - SPA

Rev

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

Rev 3496 Rev 3497
Línea 5... Línea 5...
5
 
5
 
6
const getResources = async (url, config) => {
6
const getResources = async (url, config) => {
7
  return await api.get(url, config);
7
  return await api.get(url, config);
Línea 8... Línea 8...
8
};
8
};
9
 
9
 
Línea 10... Línea 10...
10
export function useFetch(url, config = { params: undefined }) {
10
export function useFetch(url) {
Línea 11... Línea 11...
11
  const { showError } = useAlert();
11
  const { showError } = useAlert();
12
 
12
 
13
  const { loading, data, error, execute } = useApi(getResources);
13
  const { loading, data, error, execute } = useApi(getResources);
Línea 14... Línea 14...
14
 
14
 
15
  useEffect(() => {
15
  useEffect(() => {
16
    execute(url, config);
16
    execute(url);
Línea 17... Línea 17...
17
  }, [url, config]);
17
  }, [url]);
18
 
18
 
19
  useEffect(() => {
19
  useEffect(() => {
20
    if (error) showError(error);
20
    if (error) showError(error);
21
  }, [error]);
21
  }, [error]);
22
 
22