clothes.js
482 Bytes
import axios from "axios";
const CLOTHES_RECOMMEND = 'weather/RECOMMEND';
export function recommend() {
const req = axios.post('http://localhost:4000/api/clothes')
.then(res => res.data);
return {
type: CLOTHES_RECOMMEND,
payload: req,
}
}
export default function (state = {}, action) {
switch (action.type) {
case CLOTHES_RECOMMEND:
return { ...state, clothesRecommend: action.payload };
break;
default:
return state;
}
}