Skip to content
This repository has been archived by the owner on Apr 13, 2023. It is now read-only.

Commit

Permalink
Merge pull request #48 from SpringRoll/bugifx/releases-out-of-order
Browse files Browse the repository at this point in the history
fixes bug where releases showing oldest first
  • Loading branch information
chipbell4 authored Dec 20, 2018
2 parents 8e6a2ad + a64f942 commit 2848c7b
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
5 changes: 4 additions & 1 deletion app/routes/games/helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,10 @@ function renderPage(req, res, template, populate=null)
{
var game = Game.getBySlug(req.params.slug, done);
if (populate){
game.populate(populate);
game.populate({
path: populate,
options: { sort: { 'updated': -1 } }
});
};
},
function(game, done)
Expand Down
4 changes: 2 additions & 2 deletions app/routes/games/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,13 +50,13 @@ router.get('/:slug', function(req, res)
router.get('/:slug/privileges', function(req, res)
{
// have to pass addt'l param to resolve Group objects
renderPage(req, res, 'games/privileges', ['groups.group']);
renderPage(req, res, 'games/privileges', 'groups.group');
});

router.get('/:slug/releases', function(req, res)
{
// have to pass addt'l param to resolve Release objects
renderPage(req, res, 'games/releases', ['releases']);
renderPage(req, res, 'games/releases', 'releases');
});

router.patch('/:slug/releases/:commit_id', async function(req, res)
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "1.6.1",
"version": "1.6.2",
"private": true,
"devDependencies": {
"glob": "^7.1.2",
Expand Down

0 comments on commit 2848c7b

Please sign in to comment.