Skip to content

Commit

Permalink
require a sort argument
Browse files Browse the repository at this point in the history
  • Loading branch information
InventivetalentDev committed Oct 22, 2022
1 parent 9bcb85e commit db8c901
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions util.js
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,7 @@ module.exports.paginateReq = function (req, defaultFields, other) {
sort = sort.substr(1);
}
sort = sort.trim();
if (sort.length <= 0) continue;

if (sort === "id") sort = "_id";
sortObj[sort] = sortMode;
Expand Down

0 comments on commit db8c901

Please sign in to comment.