Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

My post values are not passing to component #233

Open
nagarajach opened this issue May 8, 2018 · 1 comment
Open

My post values are not passing to component #233

nagarajach opened this issue May 8, 2018 · 1 comment

Comments

@nagarajach
Copy link

nagarajach commented May 8, 2018

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');

    default:
        return state;
}

}

image
image

First 3 times getting undefined and 4th time getting promise data . Could you please help me to get resolve this issue.

Thank You

@nagarajach
Copy link
Author

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 .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant