axe-api 1.0.9 → 1.0.11

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.
@@ -9,8 +9,17 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
9
9
  });
10
10
  };
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
+ const Helpers_1 = require("../../Handlers/Helpers");
12
13
  exports.default = (context) => __awaiter(void 0, void 0, void 0, function* () {
13
- if (context.query) {
14
+ if (context.query && context.queryParser && context.conditions) {
15
+ // Users should be able to select some fields to show.
16
+ context.queryParser.applyFields(context.query, context.conditions.fields);
17
+ // Binding parent id if there is.
18
+ (0, Helpers_1.addForeignKeyQuery)(context.req, context.query, context.relation, context.parentModel);
19
+ // Users should be able to filter records
20
+ context.queryParser.applyWheres(context.query, context.conditions.q);
21
+ // User should be able to select sorting fields and types
22
+ context.queryParser.applySorting(context.query, context.conditions.sort);
14
23
  context.result = yield context.query;
15
24
  }
16
25
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "axe-api",
3
- "version": "1.0.9",
3
+ "version": "1.0.11",
4
4
  "description": "AXE API is a simple tool to create Rest APIs quickly.",
5
5
  "main": "build/index.js",
6
6
  "types": "build/index.d.ts",