@konplit-services/common 1.0.122 → 1.0.123

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.
@@ -18,7 +18,18 @@ const validAllowedFields = (allowFields) => {
18
18
  const params = Object.keys(req.params);
19
19
  const query = Object.keys(req.query);
20
20
  const body = Object.keys(req.body);
21
- const submittedFields = [...params, ...query, ...body];
21
+ const submittedFields = [
22
+ ...params,
23
+ ...query,
24
+ ...body,
25
+ "search",
26
+ "page",
27
+ "limit",
28
+ "from",
29
+ "to",
30
+ "sort_by",
31
+ "order",
32
+ ];
22
33
  const extraFields = submittedFields.filter((field) => !allowFields.includes(field));
23
34
  if (extraFields.length > 0) {
24
35
  throw new errors_1.BadRequestError(`Extra fields submitted: ${extraFields.join(", ")}`, error_codes_1.error_codes.INVALID_INPUT);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@konplit-services/common",
3
- "version": "1.0.122",
3
+ "version": "1.0.123",
4
4
  "description": "",
5
5
  "main": "./build/index.js",
6
6
  "types": "./build/index.d.ts",