fix(core-flows): fix warning for when usage in updateOrderTaxLinesWorkflow (#13738)

When starting the Medusa application i see the following in the console:

```
update-order-tax-lines: "when" name should be defined. A random one will be assigned to it, which is not recommended for production.
 ({ input }) => {
        return input.item_ids?.length > 0;
    }
update-order-tax-lines: "when" name should be defined. A random one will be assigned to it, which is not recommended for production.
 ({ input }) => {
        return input.shipping_method_ids?.length > 0;
    }
```

This PR fixes the issue by passing a step name as a first parameter to the `when` usages in `updateOrderTaxLinesWorkflow`
This commit is contained in:
Shahed Nasser
2025-10-13 11:22:22 +03:00
committed by GitHub
parent a48ee395ed
commit fc2ded4b10
2 changed files with 7 additions and 2 deletions

View File

@@ -197,7 +197,7 @@ export const updateOrderTaxLinesWorkflow = createWorkflow(
options: { isList: false },
}).config({ name: "order-query" })
const items = when({ input }, ({ input }) => {
const items = when("get-order-line-items", { input }, ({ input }) => {
return input.item_ids!?.length > 0
}).then(() => {
const { data: orderLineItems } = useQueryGraphStep({
@@ -209,7 +209,7 @@ export const updateOrderTaxLinesWorkflow = createWorkflow(
return orderLineItems
})
const shippingMethods = when({ input }, ({ input }) => {
const shippingMethods = when("get-order-shipping-methods", { input }, ({ input }) => {
return input.shipping_method_ids!?.length > 0
}).then(() => {
const { data: orderShippingMethods } = useQueryGraphStep({