Closed kamesdev closed 3 years ago
1 BUG FIXED
In order to solve this problem you should add
dispatch(getUserDetails('profile'))
to submitHandler in UserEditScreen
2 BUG FIXED
In order to solve this problem you should add
dispatch(listProductDetails(productId))
to submitHandler in ProductEditScreen
hello there thanks for finding bugs but it is not a fix. you should not dispatch(getUserDetails('profile')) on submitHandler because in the submitHandler we did not update user or product yet. will fix the issues soon and let you know on this thread.
#1 If admin goes to /admin/user/:id/edit, click update and go to own profile /profile, then name and email is filled by other user data e.g Instead of admin name there is John Doe and instead of admin@example.com there's john@example.com
#2 If admin goes to (/admin/product/:id/edit), change some values e.g. name of product, click Update, and again click to edit the same product then there's not updated version of product
For your point one, you should add:
dispatch({ type: USER_DETAILS_RESET })
userActions.js > updateUser > after dispatch dispatch({ type: USER_DETAILS_SUCCESS, payload: data })
#1 If admin goes to /admin/user/:id/edit, click update and go to own profile /profile, then name and email is filled by other user data e.g Instead of admin name there is John Doe and instead of admin@example.com there's john@example.com
#2 If admin goes to (/admin/product/:id/edit), change some values e.g. name of product, click Update, and again click to edit the same product then there's not updated version of product
For your point 2, you should add:
dispatch({ type: PRODUCT_DETAILS_SUCCESS, payload: data })
productActions.js > updateProduct > after dispatch dispatch({ type: PRODUCT_UPDATE_SUCCESS, payload: data })
#1 If admin goes to /admin/user/:id/edit, click update and go to own profile /profile, then name and email is filled by other user data e.g Instead of admin name there is John Doe and instead of admin@example.com there's john@example.com
#2 If admin goes to (/admin/product/:id/edit), change some values e.g. name of product, click Update, and again click to edit the same product then there's not updated version of product