fix: Fixes to product module and improving tests (#6898)
This commit is contained in:
@@ -58,7 +58,7 @@ export const updateProductVariantsWorkflow = createWorkflow(
|
||||
|
||||
return {
|
||||
selector: {
|
||||
ids: data.variantPriceSetLinks.map((link) => link.price_set_id),
|
||||
id: data.variantPriceSetLinks.map((link) => link.price_set_id),
|
||||
} as PricingTypes.FilterablePriceSetProps,
|
||||
update: {
|
||||
prices: data.input.update.prices,
|
||||
@@ -78,11 +78,11 @@ export const updateProductVariantsWorkflow = createWorkflow(
|
||||
},
|
||||
(data) => {
|
||||
return data.updatedVariants.map((variant, i) => {
|
||||
const linkForVariant = data.variantPriceSetLinks.find(
|
||||
const linkForVariant = data.variantPriceSetLinks?.find(
|
||||
(link) => link.variant_id === variant.id
|
||||
)
|
||||
|
||||
const priceSetForVariant = data.updatedPriceSets.find(
|
||||
const priceSetForVariant = data.updatedPriceSets?.find(
|
||||
(priceSet) => priceSet.id === linkForVariant?.price_set_id
|
||||
)
|
||||
|
||||
|
||||
@@ -15,6 +15,7 @@ export const updateProductsWorkflow = createWorkflow(
|
||||
(
|
||||
input: WorkflowData<WorkflowInput>
|
||||
): WorkflowData<ProductTypes.ProductDTO[]> => {
|
||||
// TODO: Delete price sets for removed variants
|
||||
return updateProductsStep(input)
|
||||
}
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user