chore: prevent workflow steps to call modules when not necessary (#11632)

**What**
Some steps were calling the modules even when nothing was needed which for some operations would create transaction for nothing leading to extra execution time that add up very quickly on cloud network

Co-authored-by: Carlos R. L. Rodrigues <37986729+carlos-r-l-rodrigues@users.noreply.github.com>
This commit is contained in:
Adrien de Peretti
2025-02-26 18:42:48 +01:00
committed by GitHub
parent 54a6ef91ac
commit caf83cf78c
17 changed files with 125 additions and 55 deletions

View File

@@ -1083,10 +1083,9 @@ export default class CartModuleService
)
}
const result = await this.lineItemTaxLineService_.upsert(
taxLines,
sharedContext
)
const result = taxLines.length
? await this.lineItemTaxLineService_.upsert(taxLines, sharedContext)
: []
return await this.baseRepository_.serialize<CartTypes.LineItemTaxLineDTO[]>(
result,
@@ -1201,10 +1200,12 @@ export default class CartModuleService
)
}
const result = await this.shippingMethodTaxLineService_.upsert(
taxLines as UpdateShippingMethodTaxLineDTO[],
sharedContext
)
const result = taxLines.length
? await this.shippingMethodTaxLineService_.upsert(
taxLines as UpdateShippingMethodTaxLineDTO[],
sharedContext
)
: []
return await this.baseRepository_.serialize<
CartTypes.ShippingMethodTaxLineDTO[]