-
Notifications
You must be signed in to change notification settings - Fork 63
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
fix: Cart item with additionalProperty #1325
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Doesn't this defeat the whole purpose of not having to serialize the attachment id on the frontend?
Not really. We still don't need to serialize anything on the frontend. |
It's not clear to me how it wouldn't. This is a required property on input, and we use it for the |
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. Latest deployment of this branch, based on commit 00fef03:
|
Ok, I think I've precipitated myself on openning this PR that early, however I think it's working now. We had two issues. The first one is that when fetching a product,
To fix this issue, I added a non required field on The second issue was that adding a product to cart with A good case for this PR is this store , that has specifications set and after this PR, should have the bug fixed and the cart should work as intended. Also, I added links to this PR on our official starters |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I understand the issues now. Thanks!
|
||
const getId = (item: IStoreOffer) => | ||
[ | ||
item.itemOffered.sku, | ||
item.seller.identifier, | ||
item.price, | ||
item.itemOffered.additionalProperty?.map(getPropertyId).join('-'), | ||
item.itemOffered.additionalProperty | ||
?.filter(isAttachment) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't this function be the same in the starters as well? How can we manage the fact that the starters can't know what attachments are?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On the starters side I think it's ok. The issue arises when mixing checkout API with @faststore/api
. If you are using only one or the other I think you're safe
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see. So by that logic, we are able to insert VTEX concepts in the starters, as long as they follow @faststore/api
schemas, right? That way we can guarantee they won't break if used with another platform (although it's not going to be a graceful experience).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I mean, we do that with the channel
. Channel is a concept of @faststore
, but what goes inside that string differs from each platform.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
got it!
What's the purpose of this pull request?
When adding a product to cart with additionalProperties we were receiving the following error:
This PR addresses this issue
Starters