From 58baead34e32abff3c587dbc1c6b11b527be8381 Mon Sep 17 00:00:00 2001 From: Erik Engervall Date: Sun, 4 Feb 2024 22:18:54 +0900 Subject: [PATCH] fix(admin-ui) Refactor `use-copy-promotion` to map product IDs (#6306) --- .changeset/tall-paws-accept.md | 6 ++++++ .../templates/discount-table/use-copy-promotion.tsx | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) create mode 100644 .changeset/tall-paws-accept.md diff --git a/.changeset/tall-paws-accept.md b/.changeset/tall-paws-accept.md new file mode 100644 index 0000000000..61b6ce92da --- /dev/null +++ b/.changeset/tall-paws-accept.md @@ -0,0 +1,6 @@ +--- +"@medusajs/admin-ui": patch +"@medusajs/admin": patch +--- + +fix(admin-ui) Refactor `use-copy-promotion` to map product IDs diff --git a/packages/admin-ui/ui/src/components/templates/discount-table/use-copy-promotion.tsx b/packages/admin-ui/ui/src/components/templates/discount-table/use-copy-promotion.tsx index 163efd5546..63e1a869be 100644 --- a/packages/admin-ui/ui/src/components/templates/discount-table/use-copy-promotion.tsx +++ b/packages/admin-ui/ui/src/components/templates/discount-table/use-copy-promotion.tsx @@ -50,7 +50,7 @@ const useCopyPromotion = () => { copy.rule.conditions = promotion.rule.conditions.map((cond) => ({ operator: cond.operator, ...removeFalsy({ - products: cond.products, + products: cond.products.map((product) => product.id), product_types: cond.product_types, product_tags: cond.product_tags, product_collections: cond.product_collections,