Skip to content

Commit 97a8e5c

Browse files
authored
chore(link-modules): keep promotion alias (medusajs#12928)
* chore(link-modules): keep promotion alias * chore: change promotion to promotions
1 parent 40625c8 commit 97a8e5c

File tree

3 files changed

+23
-1
lines changed

3 files changed

+23
-1
lines changed

.changeset/grumpy-comics-own.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@medusajs/link-modules": patch
3+
---
4+
5+
chore(link-modules): keep promotion alias

packages/admin/dashboard/src/routes/orders/order-detail/constants.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ const DEFAULT_RELATIONS = [
3636
"*shipping_address",
3737
"*billing_address",
3838
"*sales_channel",
39-
"*promotion",
39+
"*promotions",
4040
"*shipping_methods",
4141
"*credit_lines",
4242
"*fulfillments",

packages/modules/link-modules/src/definitions/order-promotion.ts

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,13 @@ export const OrderPromotion: ModuleJoinerConfig = {
4848
path: "promotion_link.promotions",
4949
isList: true,
5050
},
51+
/**
52+
* @deprecated use the promotions field alias instead
53+
*/
54+
promotion: {
55+
path: "promotion_link.promotions",
56+
isList: true,
57+
},
5158
},
5259
relationship: {
5360
serviceName: LINKS.OrderPromotion,
@@ -57,5 +64,15 @@ export const OrderPromotion: ModuleJoinerConfig = {
5764
isList: true,
5865
},
5966
},
67+
{
68+
serviceName: Modules.PROMOTION,
69+
entity: "Promotion",
70+
relationship: {
71+
serviceName: LINKS.OrderPromotion,
72+
primaryKey: "promotion_id",
73+
foreignKey: "id",
74+
alias: "order_link",
75+
},
76+
},
6077
],
6178
}

0 commit comments

Comments
 (0)