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