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

Fetching data from redux for admin categories #113

Closed
wants to merge 2 commits into from
Closed

Fetching data from redux for admin categories #113

wants to merge 2 commits into from

Conversation

Subhang23
Copy link
Contributor

Fixes #112

Changes: Getting data for the table using redux


export const fetchCategory =()=>{
return dispatch =>{
fetch('https://jsonplaceholder.typicode.com/posts')
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Subhang23 Use axios and from what url are you fetching?

export const fetchCategory =()=>{
return dispatch =>{
fetch('https://jsonplaceholder.typicode.com/posts')
.then(response => response.json())
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Convert the response to json in one then itself.
two then's are Not required.

@harsh-jindal
Copy link
Member

@Subhang23 Also rename the adminCategoryReducer/Action to adminAction/Reducer

@Subhang23 Subhang23 closed this May 25, 2019
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

Successfully merging this pull request may close these issues.

Connect the Categories in Admin section with backend
2 participants