Skip to content
This repository has been archived by the owner on Jan 14, 2020. It is now read-only.

Commit

Permalink
Return programs as hash instead of list
Browse files Browse the repository at this point in the history
  • Loading branch information
stenington committed May 14, 2013
1 parent 5f829ce commit c2fbec8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions routes/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -257,8 +257,8 @@ exports.programs = function programs(req, res) {
return res.send(500, "There was an error retrieving the list of programs");
}
var result = { status: 'ok', programs : {} };
result.programs = programs.map(function(p) {
return {name: p.name, shortname: p.shortname };
programs.forEach(function(p) {
result.programs[p.shortname] = {name: p.name, shortname: p.shortname };
});
return res.json(200, result);
});
Expand Down

0 comments on commit c2fbec8

Please sign in to comment.