fix(workflows-sdk): name for when/then step (#10459)

This commit is contained in:
Carlos R. L. Rodrigues
2024-12-05 15:47:42 -03:00
committed by GitHub
parent 7ff3f15d6d
commit 90ae187e09
14 changed files with 234 additions and 50 deletions
@@ -65,7 +65,7 @@ export const completeCartWorkflow = createWorkflow(
})
// If order ID does not exist, we are completing the cart for the first time
const order = when({ orderId }, ({ orderId }) => {
const order = when("create-order", { orderId }, ({ orderId }) => {
return !orderId
}).then(() => {
const cart = useRemoteQueryStep({
@@ -70,9 +70,13 @@ export const listShippingOptionsForCartWorkflow = createWorkflow(
}
)
const customerGroupIds = when({ cart }, ({ cart }) => {
return !!cart.id
}).then(() => {
const customerGroupIds = when(
"get-customer-group",
{ cart },
({ cart }) => {
return !!cart.id
}
).then(() => {
const customerQuery = useQueryGraphStep({
entity: "customer",
filters: { id: cart.customer_id },