From 97a8e5cb2e8819672803bfcd9cde19cb1ce1acc0 Mon Sep 17 00:00:00 2001 From: Riqwan Thamir Date: Wed, 16 Jul 2025 21:16:44 +0200 Subject: [PATCH] chore(link-modules): keep promotion alias (#12928) * chore(link-modules): keep promotion alias * chore: change promotion to promotions --- .changeset/grumpy-comics-own.md | 5 +++++ .../src/routes/orders/order-detail/constants.ts | 2 +- .../src/definitions/order-promotion.ts | 17 +++++++++++++++++ 3 files changed, 23 insertions(+), 1 deletion(-) create mode 100644 .changeset/grumpy-comics-own.md diff --git a/.changeset/grumpy-comics-own.md b/.changeset/grumpy-comics-own.md new file mode 100644 index 0000000000..644608aab7 --- /dev/null +++ b/.changeset/grumpy-comics-own.md @@ -0,0 +1,5 @@ +--- +"@medusajs/link-modules": patch +--- + +chore(link-modules): keep promotion alias diff --git a/packages/admin/dashboard/src/routes/orders/order-detail/constants.ts b/packages/admin/dashboard/src/routes/orders/order-detail/constants.ts index bd4668626c..1162a33181 100644 --- a/packages/admin/dashboard/src/routes/orders/order-detail/constants.ts +++ b/packages/admin/dashboard/src/routes/orders/order-detail/constants.ts @@ -36,7 +36,7 @@ const DEFAULT_RELATIONS = [ "*shipping_address", "*billing_address", "*sales_channel", - "*promotion", + "*promotions", "*shipping_methods", "*credit_lines", "*fulfillments", diff --git a/packages/modules/link-modules/src/definitions/order-promotion.ts b/packages/modules/link-modules/src/definitions/order-promotion.ts index ee1a6a0388..dba4139a2a 100644 --- a/packages/modules/link-modules/src/definitions/order-promotion.ts +++ b/packages/modules/link-modules/src/definitions/order-promotion.ts @@ -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", + }, + }, ], }