Skip to content

Commit

Permalink
fix(bodies): sort by default on name
Browse files Browse the repository at this point in the history
  • Loading branch information
WikiRik committed Sep 22, 2023
1 parent 107a827 commit bbc3b11
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 bbc3b11

Please sign in to comment.