Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

243
Vistas
Why am I unable to get response from my api using #apisauce?

Response is always returning undefined. I'm calling simple log in service using #apisauce in my react native app. Here's my implementation.

This is the handleSubmit method.

import loginApi from '../api/loginApi';

const handleSubmit = async ({email, password}) => {
    const result = await loginApi.login(email, password);
    console.log(result);
    console.log(result.data);
  };

Here is the Api call

import {create} from 'apisauce';

const apiClient = create({
  method: 'POST',
  baseURL: 'https://...',
  timeout: 10000,
});

export default apiClient;

And here's the api layer for login.

import apiClient from './client';

const loginApi = (email, password) => {
  apiClient.post('/login', {email, password});
};

export default {loginApi };

result always remains undefined. No error, no exceptions, nothing is coming in the result. I've checked the URLs, prams etc on #postman a number of times and everything is alright.

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

Result remains undefined because you're not returning anything from your loginApi.login() function.

about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda