@adaptivestone/framework 5.0.0-alpha.14 → 5.0.0-alpha.16
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/CHANGELOG.md
CHANGED
|
@@ -196,22 +196,22 @@ class AbstractController extends Base {
|
|
|
196
196
|
errors: err.message,
|
|
197
197
|
});
|
|
198
198
|
}
|
|
199
|
-
req.body = new Proxy(req.body, {
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
});
|
|
207
|
-
req.query = new Proxy(req.query, {
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
});
|
|
199
|
+
// req.body = new Proxy(req.body, {
|
|
200
|
+
// get: (target, prop) => {
|
|
201
|
+
// this.logger.warn(
|
|
202
|
+
// 'Please not use "req.body" directly. Implement "request" and use "req.appInfo.request" ',
|
|
203
|
+
// );
|
|
204
|
+
// return target[prop];
|
|
205
|
+
// },
|
|
206
|
+
// });
|
|
207
|
+
// req.query = new Proxy(req.query, {
|
|
208
|
+
// get: (target, prop) => {
|
|
209
|
+
// this.logger.warn(
|
|
210
|
+
// 'Please not use "req.query" directly. Implement "query" and use "req.appInfo.query" ',
|
|
211
|
+
// );
|
|
212
|
+
// return target[prop];
|
|
213
|
+
// },
|
|
214
|
+
// });
|
|
215
215
|
|
|
216
216
|
if (!routeObject.handler) {
|
|
217
217
|
this.logger.error(`Route object have no handler defined`);
|
package/package.json
CHANGED
|
@@ -19,8 +19,9 @@ class Pagination extends AbstractMiddleware {
|
|
|
19
19
|
async middleware(req, res, next) {
|
|
20
20
|
let { limit, maxLimit } = this.params;
|
|
21
21
|
|
|
22
|
-
limit = typeof limit !== 'number' ? parseInt(limit, 10) : 10;
|
|
23
|
-
maxLimit =
|
|
22
|
+
limit = (typeof limit !== 'number' ? parseInt(limit, 10) : limit) || 10;
|
|
23
|
+
maxLimit =
|
|
24
|
+
(typeof maxLimit !== 'number' ? parseInt(maxLimit, 10) : maxLimit) || 100;
|
|
24
25
|
|
|
25
26
|
req.appInfo.pagination = {};
|
|
26
27
|
req.appInfo.pagination.page =
|