Skip to content

Commit

Permalink
fix(bodies): sort by default on name. Fixes HELP-2306 (#795)
Browse files Browse the repository at this point in the history
  • Loading branch information
WikiRik authored Sep 22, 2023
1 parent 107a827 commit 3615ed8
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions middlewares/bodies.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@ exports.listAllBodies = async (req, res) => {
where.status = 'active';
}

if (!req.query.sort) {
req.query.sort = 'name';
}

const result = await Body.findAndCountAll({
where,
...helpers.getPagination(req.query),
Expand Down

0 comments on commit 3615ed8

Please sign in to comment.