lrf %!s(int64=2) %!d(string=hai) anos
pai
achega
589770a0f6
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      app/service/view/order.js

+ 1 - 1
app/service/view/order.js

@@ -46,8 +46,8 @@ class OrderService extends CrudService {
     ];
     pipeline.push(...step2);
     pipeline.push({ $unwind: '$data' });
-    pipeline.push({ $match: { customer } });
     pipeline.push({ $replaceRoot: { newRoot: '$data' } });
+    pipeline.push({ $match: { customer } });
     const qp = _.cloneDeep(pipeline);
     qp.push({ $sort: { 'meta.createdAt': -1 } });
     if (skip && limit) qp.push({ $skip: parseInt(skip) }, { $limit: parseInt(limit) });