Her is my first action.
export function fetchByPage() {
return function(dispatch) {
axios
.get("findAllByPage?", {
params: {
page: "bio"
}
})
.then(response =>
dispatch({
type: FETCH_BY_PAGE,
payload: response.data
})
)
.then(pageParams => {
return pageParams.payload.map(singlePayload => {
return console.log(singlePayload.queryValue);
});
});
};
}
I can can get the desired params and log them. Now i need to use these params as the params of the second api call, just after this one.. Also i'm sharing flow chart which might help understanding the issue. Thanks!
Sebastian
axios uses promises so you can chain request like this and use data from the previous request
axios .get('...') .then(response => { return axios.get('request2/' + response.data); }) .then(response => { // response data from request 2 });