Skip to content

Commit

Permalink
fix: undefined sort parameter rejected by strapi query
Browse files Browse the repository at this point in the history
  • Loading branch information
cyp3rius committed Dec 16, 2020
1 parent 1d1354b commit db749ea
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "strapi-plugin-comments",
"version": "1.0.1-beta.1",
"version": "1.0.1-beta.2",
"description": "Strapi - Comments plugin",
"strapi": {
"name": "Comments",
Expand Down
2 changes: 1 addition & 1 deletion services/comments.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ module.exports = {
const paginationEnabled = !isNil(query._start);
const params = {
...query,
_sort: paginationEnabled ? query._sort || 'created_at:desc' : undefined
_sort: paginationEnabled ? query._sort || 'created_at:desc' : 'created_at:desc',
};
const entities = query._q ?
await strapi.query( model.modelName, pluginName).search(params, ['authorUser', 'related', 'reports']) :
Expand Down

0 comments on commit db749ea

Please sign in to comment.