You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
My post values are not passing to component.
But from my network url I am able to see the data:
This is my Url 👍 http://reduxblog.herokuapp.com/api/posts?key=Hello123 Response:
[{"id":233702,"title":"Test","categories":"Test","content":"Test"},{"id":233700,"title":"Test","categories":"Test","content":"Test"},{"id":233699,"title":"Test","categories":"Test","content":"Test"}]
JUst I tried to get action payload data in 'reducer_posts.js' file. added console.log
import _ from 'lodash';
import { FETCH_POSTS } from '../actions';
export default function (state = {},action) {
console.log(action.payload);
switch (action.type) {
case FETCH_POSTS:
return _.mapKeys(action.payload.data, 'id');
default:
return state;
}
}
First 3 times getting undefined and 4th time getting promise data . Could you please help me to get resolve this issue.
Thank You
The text was updated successfully, but these errors were encountered:
If I use any other api url also I am getting same error.
Tried with different API URL too. https://jsonplaceholder.typicode.com/users
Might be some problem in my promise code.
Please help me .
Hello MR StephenGrider,
My post values are not passing to component.
But from my network url I am able to see the data:
This is my Url 👍 http://reduxblog.herokuapp.com/api/posts?key=Hello123
Response:
[{"id":233702,"title":"Test","categories":"Test","content":"Test"},{"id":233700,"title":"Test","categories":"Test","content":"Test"},{"id":233699,"title":"Test","categories":"Test","content":"Test"}]
JUst I tried to get action payload data in 'reducer_posts.js' file. added console.log
import _ from 'lodash';
import { FETCH_POSTS } from '../actions';
export default function (state = {},action) {
console.log(action.payload);
switch (action.type) {
case FETCH_POSTS:
return _.mapKeys(action.payload.data, 'id');
}
First 3 times getting undefined and 4th time getting promise data . Could you please help me to get resolve this issue.
Thank You
The text was updated successfully, but these errors were encountered: