I need a bit of help with my react native in typescript project. I am having an issue posting data with Axiospost executed with axios call is failingHere my code below
import { LOGIN_URL, showErrorAlert } from "../../utils/constants"import axios, {AxiosResponse} from "axios"import { APIUser } from "../../utils/interfaces" const [userApiData, setUserApiData] = useState<APIUser[]>([]); let tokenValue const onLogin = () => { console.log("<<< inside onlogin >>>>>") const dataToSend = { email: email, password: password, } console.log("<<< dataToSend >>>>>", dataToSend) console.log("<<< LOGIN_URL >>>>>", LOGIN_URL) axios .post<APIUser[]>(LOGIN_URL, dataToSend) .then((response:AxiosResponse) => { console.log("inside promise") console.log('response ', response) }) .catch((err) => { console.log("inside error") console.log(err) throw err }) }Heres my interface export interface APIUser { success: boolean, message: null, data: UserData } export interface UserData { userId: string, organisationId: string, email: string, firstname: string, lastName: string, userToken: string, refreshToken: string }
console.log(response)
returns nothingKindly assist me in helping me find out why this is not returning any response