docs: document when-then name
This commit is contained in:
@@ -599,7 +599,7 @@ export const subscriptionWorkflow1Highlights = [
|
||||
["16", "createWorkflow", "Create a workflow."],
|
||||
["23", "transform", "Set the customer ID to an empty string if not provided."],
|
||||
["28", "when", "If email is not set, try to retrieve customer by its ID."],
|
||||
["44", "transform", "Set the email either to the one in the input or the specified customer's email."],
|
||||
["48", "transform", "Set the email either to the one in the input or the specified customer's email."],
|
||||
]
|
||||
|
||||
```ts title="src/workflows/create-restock-subscription/index.ts" highlights={subscriptionWorkflow1Highlights}
|
||||
@@ -630,9 +630,13 @@ export const createRestockSubscriptionWorkflow = createWorkflow(
|
||||
}, (data) => {
|
||||
return data.customer.customer_id || ""
|
||||
})
|
||||
const retrievedCustomer = when({ customer }, ({ customer }) => {
|
||||
return !customer.email
|
||||
}).then(() => {
|
||||
const retrievedCustomer = when(
|
||||
"retrieve-customer-by-id",
|
||||
{ customer },
|
||||
({ customer }) => {
|
||||
return !customer.email
|
||||
}
|
||||
).then(() => {
|
||||
// @ts-ignore
|
||||
const { data } = useQueryGraphStep({
|
||||
entity: "customer",
|
||||
|
||||
Reference in New Issue
Block a user