chore(link-modules): keep promotion alias (#12928)

* chore(link-modules): keep promotion alias

* chore: change promotion to promotions
This commit is contained in:
Riqwan Thamir
2025-07-16 21:16:44 +02:00
committed by GitHub
parent 40625c82d6
commit 97a8e5cb2e
3 changed files with 23 additions and 1 deletions

View File

@@ -0,0 +1,5 @@
---
"@medusajs/link-modules": patch
---
chore(link-modules): keep promotion alias

View File

@@ -36,7 +36,7 @@ const DEFAULT_RELATIONS = [
"*shipping_address",
"*billing_address",
"*sales_channel",
"*promotion",
"*promotions",
"*shipping_methods",
"*credit_lines",
"*fulfillments",

View File

@@ -48,6 +48,13 @@ export const OrderPromotion: ModuleJoinerConfig = {
path: "promotion_link.promotions",
isList: true,
},
/**
* @deprecated use the promotions field alias instead
*/
promotion: {
path: "promotion_link.promotions",
isList: true,
},
},
relationship: {
serviceName: LINKS.OrderPromotion,
@@ -57,5 +64,15 @@ export const OrderPromotion: ModuleJoinerConfig = {
isList: true,
},
},
{
serviceName: Modules.PROMOTION,
entity: "Promotion",
relationship: {
serviceName: LINKS.OrderPromotion,
primaryKey: "promotion_id",
foreignKey: "id",
alias: "order_link",
},
},
],
}