@azteam/express 1.2.310 → 1.2.313
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.
|
@@ -74,6 +74,9 @@ function _default() {
|
|
|
74
74
|
case 11:
|
|
75
75
|
req.paginate.page = req.query.page ? Number(req.query.page) : 1;
|
|
76
76
|
req.paginate.offset = (req.paginate.page - 1) * req.paginate.limit;
|
|
77
|
+
if (req.paginate.page >= 3000) {
|
|
78
|
+
req.paginate.allowDiskUse = true;
|
|
79
|
+
}
|
|
77
80
|
if (req.query.sort_by && options.allowSortFields.includes(req.query.sort_by)) {
|
|
78
81
|
req.paginate.sort = _defineProperty({}, req.query.sort_by, req.query.sort_type === 'asc' ? 'asc' : 'desc');
|
|
79
82
|
}
|
|
@@ -81,25 +84,25 @@ function _default() {
|
|
|
81
84
|
delete req.query.sort_type;
|
|
82
85
|
delete req.query.page;
|
|
83
86
|
if (!req.query.autocomplete) {
|
|
84
|
-
_context.next =
|
|
87
|
+
_context.next = 24;
|
|
85
88
|
break;
|
|
86
89
|
}
|
|
87
90
|
if (options.autocompleteField) {
|
|
88
|
-
_context.next =
|
|
91
|
+
_context.next = 21;
|
|
89
92
|
break;
|
|
90
93
|
}
|
|
91
94
|
throw new _error.ErrorException(_error.INVALID, [{
|
|
92
95
|
field: 'autocomplete',
|
|
93
96
|
message: 'Not exists autocomplete field'
|
|
94
97
|
}]);
|
|
95
|
-
case
|
|
98
|
+
case 21:
|
|
96
99
|
req.query = _defineProperty({}, options.autocompleteField, {
|
|
97
100
|
$regex: req.query.autocomplete,
|
|
98
101
|
$options: 'i'
|
|
99
102
|
});
|
|
100
|
-
_context.next =
|
|
103
|
+
_context.next = 26;
|
|
101
104
|
break;
|
|
102
|
-
case
|
|
105
|
+
case 24:
|
|
103
106
|
_lodash["default"].map(req.query, function (value, key) {
|
|
104
107
|
if (key.endsWith('_start')) {
|
|
105
108
|
var newKey = key.replace('_start', '');
|
|
@@ -131,9 +134,9 @@ function _default() {
|
|
|
131
134
|
}
|
|
132
135
|
});
|
|
133
136
|
}
|
|
134
|
-
case 25:
|
|
135
|
-
return _context.abrupt("return", next());
|
|
136
137
|
case 26:
|
|
138
|
+
return _context.abrupt("return", next());
|
|
139
|
+
case 27:
|
|
137
140
|
case "end":
|
|
138
141
|
return _context.stop();
|
|
139
142
|
}
|
package/package.json
CHANGED
|
@@ -57,6 +57,10 @@ export default function (options = {}) {
|
|
|
57
57
|
req.paginate.page = req.query.page ? Number(req.query.page) : 1;
|
|
58
58
|
req.paginate.offset = (req.paginate.page - 1) * req.paginate.limit;
|
|
59
59
|
|
|
60
|
+
if (req.paginate.page >= 3000) {
|
|
61
|
+
req.paginate.allowDiskUse = true;
|
|
62
|
+
}
|
|
63
|
+
|
|
60
64
|
if (req.query.sort_by && options.allowSortFields.includes(req.query.sort_by)) {
|
|
61
65
|
req.paginate.sort = {
|
|
62
66
|
[req.query.sort_by]: req.query.sort_type === 'asc' ? 'asc' : 'desc',
|