fix(core-flows,types,medusa): pass /store/shipping-options fields to workflow (#13527)

cc @willbouch since you asked to be tagged if I opened this PR.

The /store/shipping-options is one of only 2 store endpoints to not allow custom `fields` to be passed(other one is /store/returns if you guys want to add it to the backlog). This PR fixes that so that custom linked models can also be retrieved.

Note: This fix reveals a bug in the next.js starter

https://github.com/medusajs/nextjs-starter-medusa/blob/eac359cc8d52f1d33d8712e18e4e0f38940afb3e/src/lib/data/fulfillment.ts#L23-L24

`fields` was previously ignored, now it errors since it tries to parse the misspelled "fulfllment"(the i is missing). It worked before since both fields are already defined by default inside the workflow. So the `fields` line is totally redundant and should be removed(ideally before merging this).   
Maybe in the next release notes it should also warn users to remove it for those that already have a modified copy of the starter.
This commit is contained in:
Leonardo Benini authored and GitHub committed 2025-09-22 13:31:59 +00:00
1 parent 3758303a1d
commit 458dd04bbf
4 files changed
+28 -10

No files matched your search

@@ -10,7 +10,11 @@ export const GET = async (
const workflow = listShippingOptionsForCartWorkflow(req.scope)
const { result: shipping_options } = await workflow.run({
input: { cart_id, is_return: !!is_return },
input: {
cart_id,
is_return: !!is_return,
fields: req.queryConfig.fields
},
})
res.json({ shipping_options })