medusa
medusa copied to clipboard
[Bug/Question]: not exposed hooks ?
Package.json file
-
Node.js version
Database and its version
Operating system name and version
Browser name
No response
What happended?
// completeCartWorkflow
// ...
createHook("orderCreated", {
order_id: createdOrder.id,
cart_id: cart.id,
})
// ...
I've seen createHook calls like these. What is the purpose of them when they aren't exposed in the end anyway? The completeCartWorkflow exposes a validate hook. So const validate = createHook(.. is at the end of the workflow exposed, e.g.
return new WorkflowResponse(createdOrder, {
hooks: [validate], // why not [validate, orderCreated, there are more..] ?
})
So is there something I don't see or are these createHook calls unused leftovers? If so I'd consider them as bugs because apparently they need to be there but are not usable right now?
I am currently looking for a hook I can use after a order with applied promotions is completed from my store / cart.
Love, Y
Expected behavior
Created hooks should be accessible.
Actual behavior
Created hooks look abandoned.
Link to reproduction repo
For example. here the hook is exposed in the createOrderWorkflow. For me the inconsistency is not understandable.
https://github.com/medusajs/medusa/blob/da270cd3e25b3067005bc2260a42a298f76436b7/packages/core/core-flows/src/order/workflows/create-order.ts#L267C2-L277C1
This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 3 days.
This issue was closed because it has been stalled for 3 days with no activity.