docs: added workflow hooks docs + changed workflow response (#8364)

* docs: added workflow hooks docs + changed workflow response

* Update page.mdx
This commit is contained in:
Shahed Nasser
2024-07-31 17:01:33 +03:00
committed by GitHub
parent 27837b8833
commit 6f973d9f2b
29 changed files with 321 additions and 167 deletions
@@ -205,8 +205,11 @@ With the steps ready, you'll create the workflow that runs these steps to update
Change the content of `src/workflows/update-product-erp/index.ts` to the following:
```ts title="src/workflows/update-product-erp/index.ts" collapsibleLines="1-5" expandButtonLabel="Show Imports"
import { createWorkflow } from "@medusajs/workflows-sdk"
```ts title="src/workflows/update-product-erp/index.ts" collapsibleLines="1-8" expandButtonLabel="Show Imports"
import {
createWorkflow,
WorkflowResponse,
} from "@medusajs/workflows-sdk"
import { UpsertProductDTO } from "@medusajs/types"
import updateProduct from "./steps/update-product"
import updateErp from "./steps/update-erp"
@@ -219,10 +222,10 @@ const updateProductAndErpWorkflow = createWorkflow(
const product = updateProduct(input)
const erpData = updateErp(input)
return {
return new WorkflowResponse({
product,
erpData,
}
})
})
export default updateProductAndErpWorkflow