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:
1 parent
a48ee395ed
commit
fc2ded4b10
2 files changed
+7
-2
No files matched your search
@@ -0,0 +1,5 @@
|
|||||||
|
---
|
||||||
|
"@medusajs/core-flows": patch
|
||||||
|
---
|
||||||
|
|
||||||
|
fix(core-flows): fix warning for when usage in updateOrderTaxLinesWorkflow
|
||||||
@@ -197,7 +197,7 @@ export const updateOrderTaxLinesWorkflow = createWorkflow(
|
|||||||
options: { isList: false },
|
options: { isList: false },
|
||||||
}).config({ name: "order-query" })
|
}).config({ name: "order-query" })
|
||||||
|
|
||||||
const items = when({ input }, ({ input }) => {
|
const items = when("get-order-line-items", { input }, ({ input }) => {
|
||||||
return input.item_ids!?.length > 0
|
return input.item_ids!?.length > 0
|
||||||
}).then(() => {
|
}).then(() => {
|
||||||
const { data: orderLineItems } = useQueryGraphStep({
|
const { data: orderLineItems } = useQueryGraphStep({
|
||||||
@@ -209,7 +209,7 @@ export const updateOrderTaxLinesWorkflow = createWorkflow(
|
|||||||
return orderLineItems
|
return orderLineItems
|
||||||
})
|
})
|
||||||
|
|
||||||
const shippingMethods = when({ input }, ({ input }) => {
|
const shippingMethods = when("get-order-shipping-methods", { input }, ({ input }) => {
|
||||||
return input.shipping_method_ids!?.length > 0
|
return input.shipping_method_ids!?.length > 0
|
||||||
}).then(() => {
|
}).then(() => {
|
||||||
const { data: orderShippingMethods } = useQueryGraphStep({
|
const { data: orderShippingMethods } = useQueryGraphStep({
|
||||||
|
|||||||
Reference in new issue
Block a user