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

Adding Admin CRUD operations #165

Closed
wants to merge 5 commits into from
Closed

Conversation

Subhang23
Copy link
Contributor

Fixes #112

Changes: Added options for the admin to view,update,add and delete categories

Surge Deployment Link: https://pr-165-sahaayak.surge.sh

@harsh-jindal harsh-jindal requested a review from ashwaniYDV July 30, 2019 15:28
@harsh-jindal
Copy link
Member

@ritwizsinha Review the PR.

Copy link
Contributor

@ritwizsinha ritwizsinha left a comment

Choose a reason for hiding this comment

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

Make these changes

src/redux/actions/adminActions.js Outdated Show resolved Hide resolved
src/components/Admin/Categories.js Outdated Show resolved Hide resolved
src/components/Admin/Categories.js Show resolved Hide resolved
src/redux/reducers/categoryReducer.js Show resolved Hide resolved
@harsh-jindal
Copy link
Member

@Subhang23 Couple of things:

  1. update doesn't work instead adds a new category.
  2. clicking on update the modals opens up and blacks out the background.
  3. Add a confirmation for delete category.
  4. In actions update and delete make text color blue and red respectively and on hover there should be a cursor.

componentDidUpdate(){
this.props.fetchCategory();
}
componentWillMount(){
Copy link
Member

Choose a reason for hiding this comment

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

Change this to componentDidMount . When fetching data from the server for the first time always use componentDidMount

return {
categories: [...state.categories.categories,action.payload],
status:200,
statusType: "addCategory"
Copy link
Member

Choose a reason for hiding this comment

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

statusType is not used anywhere remove it.

@Subhang23
Copy link
Contributor Author

Subhang23 commented Aug 2, 2019

@Subhang23 Couple of things:

  1. update doesn't work instead adds a new category.
  2. clicking on update the modals opens up and blacks out the background.
  3. Add a confirmation for delete category.
  4. In actions update and delete make text color blue and red respectively and on hover there should be a cursor.

I did not understand point 1
I have used axios.patch

@harsh-jindal
Copy link
Member

@Subhang23 Resolve the conflicts.
Still the screen blacks out for update modal. Please fix that.

@Subhang23 Subhang23 closed this Aug 4, 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
4 participants