Skip to content

Fetching data for admin page using redux#125

Open
Subhang23 wants to merge 6 commits intodsciitpatna:masterfrom
Subhang23:master
Open

Fetching data for admin page using redux#125
Subhang23 wants to merge 6 commits intodsciitpatna:masterfrom
Subhang23:master

Conversation

@Subhang23
Copy link
Contributor

Fixes #112

Changes: Added fetch ,add and delete category


export const fetchCategory =()=>{
return dispatch =>{
axios.get('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 I dont understand from which url are you fetching/posting the categories too. I requested changes before that time you have resolved without making any change.

@harsh-jindal
Copy link
Member

@Subhang23 Attach the surge link. Please follow PR template strictly.

};

export const deleteCategory =(e)=> (dispatch,getState) =>{
const config = tokenConfig(getState);
Copy link
Member

Choose a reason for hiding this comment

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

No need to create a new variable config. directly use tokenConfig(getState) in the axios call

@harsh-jindal
Copy link
Member

@Subhang23 Make the above changes. A lot of places the code can be improved but I guess that can be done later on.
Please read how the code has been written at other places of the repo and try to follow same guidelines.

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