Add optional metadata
to StorePostCartsCartLineItemsItemReq
#4229
erikengervall
started this conversation in
Feature Requests
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hey all 👋🏼
I recently started using Medusajs (looks great so far!) and was hoping it'd be possible to add
metadata
as an optional field toStorePostCartsCartLineItemsItemReq
.The creation endpoint accepts
metadata
:medusa/packages/medusa/src/api/routes/store/carts/create-line-item/index.ts
Lines 161 to 170 in 274056a
...but the update endpoint doesn't:
medusa/packages/medusa/src/api/routes/store/carts/update-line-item.ts
Lines 128 to 131 in 274056a
This is the corresponding hook:
medusa/packages/medusa-react/src/hooks/store/line-items/mutations.ts
Lines 25 to 42 in 274056a
We've got a use case where we'd like to enrich line items'
metadata
field just before entering the checkout flow. Without the addition ofmetadata
toStorePostCartsCartLineItemsItemReq
, the options I see areStorePostCartsCartLineItemsItemReq
but that acceptsmetadata
deleteItem
followed byaddItem
asaddItem
acceptsmetadata
.Thanks!
Edit: I went ahead and created a PR for this feature.
Beta Was this translation helpful? Give feedback.
All reactions