From 43c24f5a0b076b77ce9c1b2c42b8a68b1e0f92e7 Mon Sep 17 00:00:00 2001 From: olivermrbl Date: Wed, 18 Dec 2024 09:47:22 +0100 Subject: [PATCH] fix(medusa): Missing metadata field on order --- integration-tests/modules/__tests__/order/order.spec.ts | 6 ++++++ packages/medusa/src/api/admin/orders/query-config.ts | 8 +------- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/integration-tests/modules/__tests__/order/order.spec.ts b/integration-tests/modules/__tests__/order/order.spec.ts index 8e0bc18afc55a..cbe798789f093 100644 --- a/integration-tests/modules/__tests__/order/order.spec.ts +++ b/integration-tests/modules/__tests__/order/order.spec.ts @@ -30,6 +30,9 @@ medusaIntegrationTestRunner({ const created = await orderModule.createOrders({ region_id: "test_region_id", email: "foo@bar.com", + metadata: { + foo: "bar", + }, items: [ { title: "Custom Item 2", @@ -108,6 +111,9 @@ medusaIntegrationTestRunner({ payment_status: "not_paid", region_id: "test_region_id", fulfillments: [], + metadata: { + foo: "bar", + }, fulfillment_status: "not_fulfilled", summary: expect.objectContaining({ // TODO: add all summary fields diff --git a/packages/medusa/src/api/admin/orders/query-config.ts b/packages/medusa/src/api/admin/orders/query-config.ts index d05a504951260..eb6efcd2323cc 100644 --- a/packages/medusa/src/api/admin/orders/query-config.ts +++ b/packages/medusa/src/api/admin/orders/query-config.ts @@ -10,12 +10,8 @@ export const defaultAdminOrderFields = [ ] export const defaultAdminRetrieveOrderFields = [ - "id", - "display_id", + ...defaultAdminOrderFields, "region_id", - "status", - "version", - "summary", "total", "subtotal", "tax_total", @@ -36,8 +32,6 @@ export const defaultAdminRetrieveOrderFields = [ "original_shipping_tax_total", "original_shipping_subtotal", "original_shipping_total", - "created_at", - "updated_at", "*items", "*items.tax_lines", "*items.adjustments",