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 for admin page using redux #125

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open

Fetching data for admin page using redux #125

wants to merge 6 commits into from

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

src/redux/actions/adminActions.js Outdated Show resolved Hide resolved
src/redux/actions/adminActions.js Outdated Show resolved Hide resolved
@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