From 89830421c8055ac283192e2ae2f8529aaf41603e Mon Sep 17 00:00:00 2001 From: olivermrbl Date: Tue, 8 Dec 2020 14:59:33 +0100 Subject: [PATCH] hotfix(medusa): Decorate order on customers --- .../medusa/src/api/routes/admin/customers/get-customer.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/packages/medusa/src/api/routes/admin/customers/get-customer.js b/packages/medusa/src/api/routes/admin/customers/get-customer.js index ab5a28c4ae..30924754ab 100644 --- a/packages/medusa/src/api/routes/admin/customers/get-customer.js +++ b/packages/medusa/src/api/routes/admin/customers/get-customer.js @@ -18,6 +18,12 @@ export default async (req, res) => { customer.orders = await orderService.list({ customer_id: customer._id }) + customer.orders = await Promise.all( + customer.orders.map(order => { + return orderService.decorate(order, ["total", "payment_status"], []) + }) + ) + res.json({ customer }) } catch (err) { throw err