feat: Update the signatures for variants and options to follow convention (#6748)

This commit is contained in:
Stevche Radevski
2024-03-20 11:31:54 +00:00
committed by GitHub
parent a859b7895e
commit 05e857d256
9 changed files with 574 additions and 117 deletions
@@ -27,7 +27,7 @@ export async function updateProductVariants({
}
if (updateVariantsData.length) {
await productModuleService.updateVariants(updateVariantsData)
await productModuleService.upsertVariants(updateVariantsData)
}
return productsVariants
@@ -25,9 +25,10 @@ export const updateProductOptionsStep = createStep(
relations,
})
// TODO: We need to update the module's signature
// const productOptions = await service.updateOptions(data.selector, data.update)
const productOptions = []
const productOptions = await service.updateOptions(
data.selector,
data.update
)
return new StepResponse(productOptions, prevData)
},
async (prevData, { container }) => {
@@ -39,11 +40,6 @@ export const updateProductOptionsStep = createStep(
ModuleRegistrationName.PRODUCT
)
// TODO: We need to update the module's signature
// await service.upsertOptions(
// prevData.map((r) => ({
// ...r,
// }))
// )
await service.upsertOptions(prevData)
}
)
@@ -25,9 +25,10 @@ export const updateProductVariantsStep = createStep(
relations,
})
// TODO: We need to update the module's signature
// const productVariants = await service.updateVariants(data.selector, data.update)
const productVariants = []
const productVariants = await service.updateVariants(
data.selector,
data.update
)
return new StepResponse(productVariants, prevData)
},
async (prevData, { container }) => {
@@ -39,11 +40,6 @@ export const updateProductVariantsStep = createStep(
ModuleRegistrationName.PRODUCT
)
// TODO: We need to update the module's signature
// await service.upsertVariants(
// prevData.map((r) => ({
// ...r,
// }))
// )
await service.upsertVariants(prevData)
}
)