0

I need to get the data from the second nested axios call and be able to use it outside of the init function

  const init = async () => {
    await axios.get(generateSessionUrl())
      (({ data }) => data)

      (async ({ session_id }) => {

        const godSignature = await md5(`${config.devId}getgods${config.authKey}${date}`);

        await axios.get(`https://api.smitegame.com/smiteapi.svc/getgodsjson/${config.devId}/${godSignature}/${session_id}/${date}/1`)
          ((data) => {
            setGods(data);
            console.log(data.data[0].Ability_1.Description.itemDescription)
            let info = data.data;
            return info
          })
      })
  };

  • 1
    Does this answer your question? [How do I return the response from an asynchronous call?](https://stackoverflow.com/questions/14220321/how-do-i-return-the-response-from-an-asynchronous-call) – David Nov 07 '22 at 22:00

0 Answers0