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", + }, + }, ], }