feat(medusa): Improve addShippingMethod on store cart route (#3222)
This commit is contained in:
1 parent
507ad00bec
commit
6e443dc708
3 files changed
+7
-5
No files matched your search
@@ -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, {
|
const updated = await txCartService.retrieve(id, {
|
||||||
|
select: ["id"],
|
||||||
relations: ["payment_sessions"],
|
relations: ["payment_sessions"],
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
@@ -2072,16 +2072,12 @@ class CartService extends TransactionBaseService {
|
|||||||
): Promise<Cart> {
|
): Promise<Cart> {
|
||||||
return await this.atomicPhase_(
|
return await this.atomicPhase_(
|
||||||
async (transactionManager: EntityManager) => {
|
async (transactionManager: EntityManager) => {
|
||||||
const cart = await this.retrieve(cartId, {
|
const cart = await this.retrieveWithTotals(cartId, {
|
||||||
select: ["subtotal", "total"],
|
|
||||||
relations: [
|
relations: [
|
||||||
"shipping_methods",
|
"shipping_methods",
|
||||||
"discounts",
|
|
||||||
"discounts.rule",
|
|
||||||
"shipping_methods.shipping_option",
|
"shipping_methods.shipping_option",
|
||||||
"items",
|
"items",
|
||||||
"items.variant",
|
"items.variant",
|
||||||
"payment_sessions",
|
|
||||||
"items.variant.product",
|
"items.variant.product",
|
||||||
],
|
],
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in new issue
Block a user