@azteam/express 1.2.389 → 1.2.391

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.
@@ -319,7 +319,7 @@ var AdminController = /*#__PURE__*/function (_Controller) {
319
319
  _this.paginateOptions.allowSearchFields = [].concat(_toConsumableArray(_this.paginateOptions.allowSearchFields), ['is_indexing']);
320
320
  }
321
321
  _this.paginateOptions.allowSearchFields = [].concat(_toConsumableArray(_this.paginateOptions.allowSearchFields), ['status', 'created_at_start', 'created_at_end', 'modified_at_start', 'modified_at_end']);
322
- _this.paginateOptions.allowSortFields = [].concat(_toConsumableArray(_this.paginateOptions.allowSortFields), ['created_at', 'modified_at', 'status'
322
+ _this.paginateOptions.allowSortFields = [].concat(_toConsumableArray(_this.paginateOptions.allowSortFields), ['priority', 'created_at', 'modified_at', 'status'
323
323
  //
324
324
  ]);
325
325
  return _this;
@@ -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 = 23;
85
+ _context.next = 22;
87
86
  break;
88
87
  }
89
88
  if (options.autocompleteField) {
90
- _context.next = 20;
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 20:
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 = 25;
101
+ _context.next = 24;
103
102
  break;
104
- case 23:
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 25:
135
+ case 24:
137
136
  return _context.abrupt("return", next());
138
- case 26:
137
+ case 25:
139
138
  case "end":
140
139
  return _context.stop();
141
140
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@azteam/express",
3
- "version": "1.2.389",
3
+ "version": "1.2.391",
4
4
  "license": "MIT",
5
5
  "author": "toda <sp.azsolution.net@gmail.com>",
6
6
  "main": "./lib/index.js",
@@ -66,6 +66,7 @@ class AdminController extends Controller {
66
66
  ];
67
67
  this.paginateOptions.allowSortFields = [
68
68
  ...this.paginateOptions.allowSortFields,
69
+ 'priority',
69
70
  'created_at',
70
71
  'modified_at',
71
72
  'status',
@@ -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 = {