chore(workflows-sdk): fix examples in TSDocs (#11689)

This commit is contained in:
Shahed Nasser authored and GitHub committed 2025-03-03 12:20:21 +02:00
1 parent d1efad9bf0
commit 61a0e4f3cf
4 files changed
+16 -14

No files matched your search

@@ -343,12 +343,12 @@ function wrapConditionalStep(
* "createProductStep",
* async function (
* input: CreateProductInput,
* context
* { container }
* ) {
* const productService = context.container.resolve(
* "productService"
* const productModuleService = container.resolve(
* "product"
* )
* const product = await productService.createProducts(input)
* const product = await productModuleService.createProducts(input)
* return new StepResponse({
* product
* }, {
@@ -357,12 +357,15 @@ function wrapConditionalStep(
* },
* async function (
* input,
* context
* { container }
* ) {
* const productService = context.container.resolve(
* "productService"
* if (!input) {
* return
* }
* const productModuleService = container.resolve(
* "product"
* )
* await productService.deleteProducts(input.product_id)
* await productModuleService.deleteProducts([input.product_id])
* }
* )
*/
@@ -46,7 +46,6 @@ global[OrchestrationUtils.SymbolMedusaWorkflowComposerContext] = null
* import {
* createProductStep,
* getProductStep,
* createPricesStep
* } from "./steps"
*
* interface WorkflowInput {
@@ -60,7 +59,6 @@ global[OrchestrationUtils.SymbolMedusaWorkflowComposerContext] = null
* // during the execution. Including the data access.
*
* const product = createProductStep(input)
* const prices = createPricesStep(product)
* return new WorkflowResponse(getProductStep(product.id))
* }
* )
@@ -16,7 +16,6 @@ import { OrchestrationUtils } from "@medusajs/utils"
* } from "@medusajs/framework/workflows-sdk"
* import {
* createProductStep,
* getProductStep,
* createPricesStep,
* attachProductToSalesChannelStep
* } from "./steps"
@@ -35,8 +34,10 @@ import { OrchestrationUtils } from "@medusajs/utils"
* attachProductToSalesChannelStep(product)
* )
*
* const id = product.id
* return new WorkflowResponse(getProductStep(product.id))
* return new WorkflowResponse({
* prices,
* productSalesChannel
* })
* }
* )
*/
@@ -36,7 +36,7 @@ type ThenFunc = <ThenResolver extends () => any>(
* } from "@medusajs/framework/workflows-sdk"
* // step imports...
*
* const workflow = createWorkflow(
* export const workflow = createWorkflow(
* "workflow",
* function (input: {
* is_active: boolean