-
-
Notifications
You must be signed in to change notification settings - Fork 3k
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
feat(medusa): Add metadata
to StorePostCartsCartLineItemsItemReq
#4230
feat(medusa): Add metadata
to StorePostCartsCartLineItemsItemReq
#4230
Conversation
Someone is attempting to deploy a commit to the medusajs Team on Vercel. A member of the Team first needs to authorize it. |
🦋 Changeset detectedLatest commit: bf56127 The changes in this PR will be included in the next version bump. This PR includes changesets to release 2 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
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.
Thanks for the contribution @erikengervall. I have a minor suggestion. Let me know what you think :)
@@ -89,7 +89,7 @@ export default async (req, res) => { | |||
variant_id: existing.variant.id, | |||
region_id: cart.region_id, | |||
quantity: validated.quantity, | |||
metadata: existing.metadata || {}, | |||
metadata: validated.metadata || existing.metadata || {}, |
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.
todo: I believe we can do validated.metadata || {}
and let our dedicated update metadata util take care of this. The new and existing metadata will be merged correctly in the LineItemService.update
method.
Would be good with a test to verify
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.
Merging sounds even better 👍🏼
Feel free to make the change, if not I’ll have a look tomorrow (it’s late here) 🙂
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.
All good - I'll push the changes so we can include it in today's release :)
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.
But otherwise LGTM, feel free to merge as you please :)
…ub.com:erikengervall/medusa into feat/add-metadata-to-update-line-item-endpoint
5a6c2fd
to
bf56127
Compare
This is my first contribution.
I tried my best to follow the available documentation on how to contribute -- LMK if there's anything missing 🙏🏼
What - what changes are in this PR
This PR adds the Line Item
metadata
field to theStorePostCartsCartLineItemsItemReq
request.If omitted, no changes are applied.
Why - why are these changes relevant
I created a feature request very recently and figured I'd take a stab at creating a PR myself. Here's a quote of the particular use case:
How - how have the changes been implemented
Not sure what this refers to.
The changes were developed locally and pushed to a new branch on my fork.
Testing - how has the changes been tested or how can the reviewer test the feature
Two additional unit tests have been created to cover this particular functionality.