@azteam/express 1.2.400 → 1.2.401

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -55,7 +55,8 @@ var AdminController = /*#__PURE__*/function (_Controller) {
55
55
  case 0:
56
56
  _context.next = 2;
57
57
  return _this.repository.findAll(req.query, {
58
- limit: 2000
58
+ limit: 2000,
59
+ lean: true
59
60
  });
60
61
  case 2:
61
62
  data = _context.sent;
@@ -79,7 +80,9 @@ var AdminController = /*#__PURE__*/function (_Controller) {
79
80
  switch (_context2.prev = _context2.next) {
80
81
  case 0:
81
82
  _context2.next = 2;
82
- return _this.repository.find(req.query, req.paginate);
83
+ return _this.repository.find(req.query, _objectSpread(_objectSpread({}, req.paginate), {}, {
84
+ lean: true
85
+ }));
83
86
  case 2:
84
87
  paginateData = _context2.sent;
85
88
  return _context2.abrupt("return", res.success(paginateData, _this.guardResponse, _this.allowResponse));
@@ -102,7 +105,9 @@ var AdminController = /*#__PURE__*/function (_Controller) {
102
105
  switch (_context3.prev = _context3.next) {
103
106
  case 0:
104
107
  _context3.next = 2;
105
- return _this.repository.findTrash(req.query, req.paginate);
108
+ return _this.repository.findTrash(req.query, _objectSpread(_objectSpread({}, req.paginate), {}, {
109
+ lean: true
110
+ }));
106
111
  case 2:
107
112
  paginateData = _context3.sent;
108
113
  return _context3.abrupt("return", res.success(paginateData, _this.guardResponse, _this.allowResponse));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@azteam/express",
3
- "version": "1.2.400",
3
+ "version": "1.2.401",
4
4
  "license": "MIT",
5
5
  "author": "toda <sp.azsolution.net@gmail.com>",
6
6
  "main": "./lib/index.js",
@@ -77,6 +77,7 @@ class AdminController extends Controller {
77
77
  methodGetAll = async (req, res) => {
78
78
  const data = await this.repository.findAll(req.query, {
79
79
  limit: 2000,
80
+ lean: true,
80
81
  });
81
82
  return res.success(data, this.guardResponse, this.allowResponse);
82
83
  };
@@ -90,7 +91,10 @@ class AdminController extends Controller {
90
91
  }
91
92
 
92
93
  methodGetPaginate = async (req, res) => {
93
- const paginateData = await this.repository.find(req.query, req.paginate);
94
+ const paginateData = await this.repository.find(req.query, {
95
+ ...req.paginate,
96
+ lean: true,
97
+ });
94
98
  return res.success(paginateData, this.guardResponse, this.allowResponse);
95
99
  };
96
100
 
@@ -107,7 +111,10 @@ class AdminController extends Controller {
107
111
  }
108
112
 
109
113
  methodGetPaginateTrash = async (req, res) => {
110
- const paginateData = await this.repository.findTrash(req.query, req.paginate);
114
+ const paginateData = await this.repository.findTrash(req.query, {
115
+ ...req.paginate,
116
+ lean: true,
117
+ });
111
118
  return res.success(paginateData, this.guardResponse, this.allowResponse);
112
119
  };
113
120