identity-admin 1.24.3 → 1.24.4

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.
@@ -514,18 +514,20 @@ let DashboardController = DashboardController_1 = class DashboardController {
514
514
  const sort = modifiedResource.properties.defaultOrder;
515
515
  const nextQuery = {};
516
516
  const prevQuery = {};
517
- const sortQuery = {};
517
+ const nextSortQuery = {};
518
+ const previousSortQuery = {};
518
519
  const greaterThanQuery = { $gt: record[sortBy] };
519
520
  const lessThanQuery = { $lt: record[sortBy] };
520
521
  nextQuery[sortBy] = sort === 'asc' ? greaterThanQuery : lessThanQuery;
521
522
  prevQuery[sortBy] = sort === 'asc' ? lessThanQuery : greaterThanQuery;
522
- sortQuery[sortBy] = sort;
523
+ nextSortQuery[sortBy] = sort;
524
+ previousSortQuery[sortBy] = sort === 'asc' ? 'desc' : 'asc';
523
525
  var neighbor;
524
526
  if (neighborRecordType === helpers_1.NeighborTypes.NEXT) {
525
- neighbor = yield (model === null || model === void 0 ? void 0 : model.findOne(nextQuery).sort(sortQuery).limit(1));
527
+ neighbor = yield (model === null || model === void 0 ? void 0 : model.findOne(nextQuery).sort(nextSortQuery).limit(1));
526
528
  }
527
529
  else {
528
- neighbor = yield (model === null || model === void 0 ? void 0 : model.findOne(prevQuery).sort(sortQuery).limit(1));
530
+ neighbor = yield (model === null || model === void 0 ? void 0 : model.findOne(prevQuery).sort(previousSortQuery).limit(1));
529
531
  }
530
532
  const hasNeighbor = record && neighbor && neighbor._id ? true : false;
531
533
  const neighborRecordId = hasNeighbor ? neighbor._id : undefined;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "identity-admin",
3
- "version": "1.24.3",
3
+ "version": "1.24.4",
4
4
  "description": "",
5
5
  "main": "lib/Dashboard.js",
6
6
  "types": "lib/Dashbord.d.ts",