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

Commit

Permalink
games API works with status levels, no discrete status buckets
Browse files Browse the repository at this point in the history
  • Loading branch information
bigtimebuddy committed Dec 15, 2015
1 parent c5be87f commit 4621c42
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions app/routes/api/games.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,18 @@ router.get('/', function(req, res)
return response.call(res, "Invalid Arguments");
}

var status = req.query.status || "prod";
var status = req.query.status || 'prod';
var token = req.query.token;
var statuses = ['dev', 'qa', 'stage', 'prod'];

// The status is inclusive of status levels greater than the current
// for instance, QA status means the latest QA, Stage or Prod release
statuses = statuses.slice(statuses.indexOf(status));

var populateOptions = {
path: 'releases',
select: 'status updated commitId',
match: {'status': {$in: [status]}},
select: 'status updated commitId version',
match: {'status': {$in: statuses}},
options: {
sort: {updated: -1},
limit: 1
Expand Down

0 comments on commit 4621c42

Please sign in to comment.