Closed akrajna closed 3 years ago
Hi @akrajna
I faced the same problem, a fix is available for the "update personal data" which can be found below
Bug: https://github.com/DivanteLtd/vsf-capybara/issues/510 Fix: https://github.com/DivanteLtd/vsf-capybara/commit/bac3e5ea6e74c4cba470486407dc0ea3520173fd
To get the shipping details working, you will need to implement a similar fix to components/organisms/o-my-account-shipping-details.vue
Add the following imports
import config from 'config';
import pick from 'lodash-es/pick';
Update line 247
from
let userDataToUpdate = this.$store.state.user.current;
to
let userDataToUpdate = pick(this.$store.state.user.current, config.users.allowModification);
Ensure allowModification is present under "users" in the config/default.json
"users": {
"autoRefreshTokens": true,
"loginAfterCreatePassword": true,
"endpoint": "/api/user",
"history_endpoint": "/api/user/order-history?token={{token}}&pageSize={{pageSize}}¤tPage={{currentPage}}",
"resetPassword_endpoint": "/api/user/reset-password",
"createPassword_endpoint": "/api/user/create-password",
"changePassword_endpoint": "/api/user/change-password?token={{token}}",
"login_endpoint": "/api/user/login",
"create_endpoint": "/api/user/create",
"me_endpoint": "/api/user/me?token={{token}}",
"refresh_endpoint": "/api/user/refresh",
"allowModification": ["firstname", "lastname", "email", "addresses"]
}
The fix only sets the required customer details, in this case firstname, lastname, email and address. Previously it was sending the entire customer data, causing the API to throw an error and return a 500.
The delete address has the same issue
The fix in my previous comment needs to be appleid to the method deleteAddress in the same file components/organisms/o-my-account-shipping-details.vue
Update
let userDataToUpdate = this.$store.state.user.current;
to
let userDataToUpdate = pick(this.$store.state.user.current, config.users.allowModification);
For VSF Next - @filipsobol is working on that right now For VSF1 x Capybara - @AdamPawlinski will handle issues with updating & removing shipping details - thanks for useful snippets @AddyAhmed
VSF Next now supports updating My Account data.
Current behavior
It is impossible to change data in 'My profile' and 'Shipping' sections in 'my account'. Changes made are not saved.
Expected behavior
It should be possible to change data in 'My profile' and 'Shipping' sections in 'my account'. Changes should be saved.
Steps to reproduce the issue
initial condition: user is logged in
related to the issue: https://github.com/DivanteLtd/vsf-pro/issues/34
Repository
Next - https://lovecrafts-demo.storefrontcloud.io/
Can you handle fixing this bug by yourself?
Which Release Cycle state this refers to? Info for developer.
Pick one option.
develop
branch and create Pull Request2. Feature / Improvement
back todevelop
.release
branch and create Pull Request3. Stabilisation fix
back torelease
.hotfix
ormaster
branch and create Pull Request4. Hotfix
back tohotfix
.Environment details
Additional information