Skip to content

Commit

Permalink
Add default sort order
Browse files Browse the repository at this point in the history
  • Loading branch information
hagopj13 committed Oct 3, 2020
1 parent 9e3a3ef commit cfc0ce0
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/models/plugins/paginate.plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ const paginate = (schema) => {
sortingCriteria.push((order === 'desc' ? '-' : '') + key);
});
sort = sortingCriteria.join(' ');
} else {
sort = 'createdAt';
}

const limit = options.limit && parseInt(options.limit, 10) > 0 ? parseInt(options.limit, 10) : 10;
Expand Down

0 comments on commit cfc0ce0

Please sign in to comment.