Created
February 6, 2018 14:08
-
-
Save yogieputra8/9005b977a668e6c114477ea54d51dbf2 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import axios from 'axios' | |
export const FETCH_DATA = 'FETCH_DATA' | |
export const fetchData = () => { | |
return { | |
type: FETCH_DATA | |
} | |
} | |
export const FETCH_BANNERS = 'FETCH_BANNERS' | |
export const fetchBanners = () => { | |
return { | |
type: FETCH_BANNERS, | |
payload: getBanner() | |
} | |
} | |
const getBanner = async () => { | |
const url_banners = `http://172.104.50.9:3000/api/banner_lists` | |
return axios.get(url_banners) | |
.then(res => { | |
console.log(res.data) | |
return res.data | |
}) | |
.catch(err => { | |
console.log(err) | |
}) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment