Skip to content

Commit

Permalink
fix: return mutated values when mapping over products during create+u…
Browse files Browse the repository at this point in the history
…pdate
  • Loading branch information
thetutlage authored and sradevski committed May 15, 2024
1 parent e8a726a commit 83be029
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions packages/modules/product/src/services/product-module-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1168,9 +1168,12 @@ export default class ProductModuleService<
): Promise<TProduct[]> {
const normalizedInput = await promiseAll(
data.map(async (d) => {
await this.normalizeCreateProductInput(d, sharedContext)
this.validateProductPayload(d)
return d
const normalized = await this.normalizeCreateProductInput(
d,
sharedContext
)
this.validateProductPayload(normalized)
return normalized
})
)

Expand Down Expand Up @@ -1228,9 +1231,12 @@ export default class ProductModuleService<
): Promise<TProduct[]> {
const normalizedInput = await promiseAll(
data.map(async (d) => {
await this.normalizeUpdateProductInput(d, sharedContext)
this.validateProductPayload(d)
return d
const normalized = await this.normalizeUpdateProductInput(
d,
sharedContext
)
this.validateProductPayload(normalized)
return normalized
})
)

Expand Down

0 comments on commit 83be029

Please sign in to comment.