Skip to content

Commit

Permalink
fix(medusa): pricing module list prices return type (#5715)
Browse files Browse the repository at this point in the history
  • Loading branch information
pKorsholm authored Nov 26, 2023
1 parent 0df1c7d commit aa6c4cb
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/nervous-countries-smell.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@medusajs/medusa": patch
---

fix(medusa): alwyas add price_list_id and price_list to money_amounts when listing for pricing module
4 changes: 3 additions & 1 deletion packages/medusa/src/services/pricing.ts
Original file line number Diff line number Diff line change
Expand Up @@ -736,10 +736,12 @@ class PricingService extends TransactionBaseService {
(pr) => pr.rule_type.rule_attribute === "region_id"
)?.value

delete priceSetMoneyAmount.money_amount?.price_set_money_amount
const moneyAmount = {
...priceSetMoneyAmount.money_amount,
region_id: null as null | string,
price_list_id: priceSetMoneyAmount.price_list?.id,
price_list_id: priceSetMoneyAmount.price_list?.id ?? null,
price_list: priceSetMoneyAmount.price_list ?? null,
}

if (regionId) {
Expand Down

0 comments on commit aa6c4cb

Please sign in to comment.