title: How to get data from axios call in redux action? React JS search project
body: <p>I have a search of weather for some cities. I would like to create info modal when a user tries to find a city that is not in the base. In this case I receive <code>404</code> error from my API. </p>
  
  <p>I fetch the data every time when user click on search button. I use <code>axios</code> to do it and whole project is based on React and Redux. Everything is clear for me but I have a problem with pass valid response to <code>payload</code>. 
  How should I do it? In an another file and use react component lifecycle? </p>
  
  <p>action.js</p>
  
  <pre><code>export function fetchWeather(city) {
      const url = `${ROOT_URL}&amp;q=${city}`;
  
      axios.get(url)
      .then(function (response) {
        console.log(response);
      })
      .catch(function (error) { 
        console.log(error);
      });
  
      return {
          type: FETCH_WEATHER,
          payload: request
      };
  }
  </code></pre>