docs: fix issues in product builder tutorial (#13505)
This commit is contained in:
@@ -764,7 +764,7 @@ You also pass the product builder record to the compensation function, which del
|
||||
|
||||
The `prepareProductBuilderCustomFieldsStep` receives the custom fields from the workflow's input and returns which custom fields should be created, updated, or deleted.
|
||||
|
||||
To create the step, create the file `src/workflows/upsert-product-builder.ts` with the following content:
|
||||
To create the step, create the file `src/workflows/steps/prepare-product-builder-custom-fields.ts` with the following content:
|
||||
|
||||
export const prepareCustomFieldsStepHighlights = [
|
||||
["21", "listProductBuilderCustomFields", "Get existing custom fields."],
|
||||
@@ -772,7 +772,7 @@ export const prepareCustomFieldsStepHighlights = [
|
||||
["27", "toUpdate", "Custom fields to update."]
|
||||
]
|
||||
|
||||
```ts title="src/workflows/upsert-product-builder.ts" highlights={prepareCustomFieldsStepHighlights}
|
||||
```ts title="src/workflows/steps/prepare-product-builder-custom-fields.ts" highlights={prepareCustomFieldsStepHighlights}
|
||||
import { createStep, StepResponse } from "@medusajs/framework/workflows-sdk"
|
||||
import { PRODUCT_BUILDER_MODULE } from "../../modules/product-builder"
|
||||
|
||||
@@ -822,7 +822,7 @@ export const prepareCustomFieldsStepHighlights2 = [
|
||||
["26", "toDelete", "Add the custom field to this array if it exists but isn't in the input."]
|
||||
]
|
||||
|
||||
```ts title="src/workflows/upsert-product-builder.ts" highlights={prepareCustomFieldsStepHighlights2}
|
||||
```ts title="src/workflows/steps/prepare-product-builder-custom-fields.ts" highlights={prepareCustomFieldsStepHighlights2}
|
||||
// Process input fields to determine creates vs updates
|
||||
input.custom_fields?.forEach((fieldData) => {
|
||||
const existingField = existingCustomFields.find((f) => f.id === fieldData.id)
|
||||
@@ -1671,6 +1671,8 @@ when({
|
||||
.then(() => {
|
||||
dismissRemoteLinkStep(deletedComplementaryProductLinks)
|
||||
})
|
||||
|
||||
// TODO manage addon products
|
||||
```
|
||||
|
||||
In this portion of the workflow, you:
|
||||
|
||||
@@ -6564,7 +6564,7 @@ export const generatedEditDates = {
|
||||
"app/commerce-modules/order/order-totals/page.mdx": "2025-07-31T15:12:10.633Z",
|
||||
"app/commerce-modules/user/invite-user-subscriber/page.mdx": "2025-08-01T12:01:54.551Z",
|
||||
"app/how-to-tutorials/tutorials/invoice-generator/page.mdx": "2025-08-04T00:00:00.000Z",
|
||||
"app/how-to-tutorials/tutorials/product-builder/page.mdx": "2025-09-01T14:59:43.128Z",
|
||||
"app/how-to-tutorials/tutorials/product-builder/page.mdx": "2025-09-15T10:44:37.801Z",
|
||||
"app/integrations/guides/payload/page.mdx": "2025-09-08T15:06:32.588Z",
|
||||
"references/js_sdk/admin/Client/methods/js_sdk.admin.Client.getToken/page.mdx": "2025-08-14T12:59:55.678Z",
|
||||
"app/commerce-modules/order/draft-orders/page.mdx": "2025-08-26T09:21:49.780Z",
|
||||
|
||||
Reference in New Issue
Block a user