From fc2ded4b100432236a14d9f6409e8c6ea5a84269 Mon Sep 17 00:00:00 2001 From: Shahed Nasser Date: Mon, 13 Oct 2025 11:22:22 +0300 Subject: [PATCH] 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` --- .changeset/twenty-carrots-matter.md | 5 +++++ .../core/core-flows/src/order/workflows/update-tax-lines.ts | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) create mode 100644 .changeset/twenty-carrots-matter.md diff --git a/.changeset/twenty-carrots-matter.md b/.changeset/twenty-carrots-matter.md new file mode 100644 index 0000000000..103fc8118d --- /dev/null +++ b/.changeset/twenty-carrots-matter.md @@ -0,0 +1,5 @@ +--- +"@medusajs/core-flows": patch +--- + +fix(core-flows): fix warning for when usage in updateOrderTaxLinesWorkflow diff --git a/packages/core/core-flows/src/order/workflows/update-tax-lines.ts b/packages/core/core-flows/src/order/workflows/update-tax-lines.ts index 3dd426c27b..c3689418c2 100644 --- a/packages/core/core-flows/src/order/workflows/update-tax-lines.ts +++ b/packages/core/core-flows/src/order/workflows/update-tax-lines.ts @@ -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({