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

Found an issue when saving any kind of address, where the ID of the a… #257

Open
wants to merge 2 commits into
base: development
Choose a base branch
from

Conversation

jwsadler
Copy link

@jwsadler jwsadler commented Mar 7, 2024

…ddress was removed by the diff function and caused the patch to fail.

Extended the diff function to include an additional optional array of field names, that forces the diff function to always inclulde the listed fields.

…ddress was removed by the diff function and caused the patch to fail.

Extended the diff function to include an additional optional array of field names, that forces the diff function to always inclulde the listed fields.
Copy link

vercel bot commented Mar 7, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
sitecore-commerce-headstart-react-admin ✅ Ready (Inspect) Visit Preview 💬 Add feedback Mar 7, 2024 10:02pm

@jwsadler
Copy link
Author

jwsadler commented Mar 7, 2024

fixes #256

…sed inthe array where the value do not match
Copy link
Collaborator

@crhistianramirez crhistianramirez left a comment

Choose a reason for hiding this comment

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

@jwsadler thanks for you pull request. Instead of changing the diff function, can we instead change updateOrderCloudAddress to use address.ID instead of fields.ID? This is why I think that option is a little bit better:

  1. Keeps diff functionality unchanged, name of function does what it says without exceptions
  2. Matches pattern already defined in the codebase. Buyer for example
  3. The request body sent to the API reflects the fields we truly want to change and nothing more. Current solution will needlessly send an "ID" field. Not a huge deal but better if we can avoid it

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.

3 participants