@azteam/express 1.2.315 → 1.2.317
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.
package/lib/AdminController.js
CHANGED
|
@@ -199,17 +199,15 @@ var AdminController = /*#__PURE__*/function (_Controller) {
|
|
|
199
199
|
return _this.beforeModify(req.body);
|
|
200
200
|
case 7:
|
|
201
201
|
data = _context6.sent;
|
|
202
|
-
|
|
203
|
-
item.
|
|
202
|
+
_context6.next = 10;
|
|
203
|
+
return item.modify(data, req.user.id);
|
|
204
|
+
case 10:
|
|
204
205
|
_context6.next = 12;
|
|
205
|
-
return item.save();
|
|
206
|
-
case 12:
|
|
207
|
-
_context6.next = 14;
|
|
208
206
|
return _this.afterModify(item);
|
|
209
|
-
case
|
|
207
|
+
case 12:
|
|
210
208
|
item = _context6.sent;
|
|
211
209
|
return _context6.abrupt("return", res.success(item, _this.guardResponse, _this.allowResponse));
|
|
212
|
-
case
|
|
210
|
+
case 14:
|
|
213
211
|
case "end":
|
|
214
212
|
return _context6.stop();
|
|
215
213
|
}
|
|
@@ -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
package/src/AdminController.js
CHANGED
|
@@ -148,9 +148,7 @@ class AdminController extends Controller {
|
|
|
148
148
|
|
|
149
149
|
const data = await this.beforeModify(req.body);
|
|
150
150
|
|
|
151
|
-
item.
|
|
152
|
-
item.modified_id = req.user.id;
|
|
153
|
-
await item.save();
|
|
151
|
+
await item.modify(data, req.user.id);
|
|
154
152
|
|
|
155
153
|
item = await this.afterModify(item);
|
|
156
154
|
|
|
@@ -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',
|