Я работаю над погодным приложением, используя обещание action.payLoad.data
, и не action.payLoad.data
найти action.payLoad.data
.
actions/index.js
import axios from 'axios';
const API_KEY = 'xxxxxxxxx';
const ROOT_URL = 'http://api.openweathermap.org/data/2.5/forecast?appid=${API_KEY}';
export const FETCH_WEATHER = 'FETCH_WEATHER';
export function fetchWeather(city) {
const url = '${ROOT_URL}&q=${city},us';
const request = axios.get(url);
//console.log("request:", request);
return {
type: FETCH_WEATHER,
payLoad: request
};
}