Skip to content

Commit c88433d

Browse files
committed
pr comments
1 parent 9db6646 commit c88433d

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

packages/core/core-flows/src/product/workflows/link-product-options-to-product.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import {
1010
createProductOptionsStep,
1111
linkProductOptionsToProductStep,
1212
} from "../steps"
13+
import { isString } from "@medusajs/framework/utils"
1314

1415
/**
1516
* The data to add/remove one or more product options to/from a product.
@@ -61,7 +62,7 @@ export const linkProductOptionsToProductWorkflow = createWorkflow(
6162
linkProductOptionsToProductWorkflowId,
6263
(input: WorkflowData<LinkProductOptionsToProductWorkflowInput>) => {
6364
const optionsToCreate = transform({ input }, ({ input }) => {
64-
return (input.add ?? []).filter((option) => !(typeof option === "string"))
65+
return (input.add ?? []).filter((option) => !isString(option))
6566
}) as ProductTypes.CreateProductOptionDTO[]
6667

6768
const createdIds = when(
@@ -80,7 +81,7 @@ export const linkProductOptionsToProductWorkflow = createWorkflow(
8081
{ input, createdIds },
8182
({ input, createdIds }) => {
8283
return (input.add ?? [])
83-
.filter((option) => typeof option === "string")
84+
.filter((option) => isString(option))
8485
.concat(createdIds ? createdIds : [])
8586
}
8687
)

0 commit comments

Comments
 (0)