feat(medusa): Improve addShippingMethod on store cart route (#3222)
This commit is contained in:
committed by
GitHub
parent
507ad00bec
commit
6e443dc708
5
.changeset/brown-drinks-flow.md
Normal file
5
.changeset/brown-drinks-flow.md
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"@medusajs/medusa": patch
|
||||
---
|
||||
|
||||
chore(medusa): Improve addShippingMethod on store cart route to use new totals calculation algo
|
||||
@@ -80,6 +80,7 @@ export default async (req, res) => {
|
||||
)
|
||||
|
||||
const updated = await txCartService.retrieve(id, {
|
||||
select: ["id"],
|
||||
relations: ["payment_sessions"],
|
||||
})
|
||||
|
||||
|
||||
@@ -2072,16 +2072,12 @@ class CartService extends TransactionBaseService {
|
||||
): Promise<Cart> {
|
||||
return await this.atomicPhase_(
|
||||
async (transactionManager: EntityManager) => {
|
||||
const cart = await this.retrieve(cartId, {
|
||||
select: ["subtotal", "total"],
|
||||
const cart = await this.retrieveWithTotals(cartId, {
|
||||
relations: [
|
||||
"shipping_methods",
|
||||
"discounts",
|
||||
"discounts.rule",
|
||||
"shipping_methods.shipping_option",
|
||||
"items",
|
||||
"items.variant",
|
||||
"payment_sessions",
|
||||
"items.variant.product",
|
||||
],
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user