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