Browse Source

fix(admin-ui): Display guest orders in OrderList

Michael Bromley 4 years ago
parent
commit
c1dcb19946

+ 10 - 6
packages/admin-ui/src/lib/order/src/components/order-list/order-list.component.ts

@@ -209,18 +209,22 @@ export class OrderListComponent
                 };
             }
         }
+        if (customerNameSearchTerm) {
+            filter.customerLastName = {
+                contains: customerNameSearchTerm,
+            };
+        }
+        if (orderCodeSearchTerm) {
+            filter.code = {
+                contains: orderCodeSearchTerm,
+            };
+        }
         return {
             options: {
                 skip,
                 take,
                 filter: {
                     ...(filter ?? {}),
-                    code: {
-                        contains: orderCodeSearchTerm,
-                    },
-                    customerLastName: {
-                        contains: customerNameSearchTerm,
-                    },
                 },
                 sort: {
                     updatedAt: SortOrder.DESC,