File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed
packages/core/core-flows/src/product/workflows Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff 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 )
You can’t perform that action at this time.
0 commit comments