Skip to content
This repository has been archived by the owner on Jun 2, 2024. It is now read-only.

Commit

Permalink
only return package name in /-/all and /-/all/since, fixed #291
Browse files Browse the repository at this point in the history
  • Loading branch information
dead-horse committed Mar 24, 2014
1 parent 7cb7a51 commit ce5c979
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 4 deletions.
13 changes: 11 additions & 2 deletions controllers/registry/module.js
Original file line number Diff line number Diff line change
Expand Up @@ -903,7 +903,11 @@ function parseModsForList(updated, mods, ctx) {
exports.listAllModules = function *() {
var updated = Date.now();
var mods = yield Module.listSince(0);
this.body = parseModsForList(updated, mods, this);
var result = { _updated: updated };
mods.forEach(function (mod) {
result[mod.name] = true;
});
this.body = result;
};

exports.listAllModulesSince = function *() {
Expand All @@ -921,7 +925,12 @@ exports.listAllModulesSince = function *() {
var startkey = Number(query.startkey) || 0;
var updated = Date.now();
var mods = yield Module.listSince(startkey);
this.body = parseModsForList(updated, mods, this);
var result = { _updated: updated };
mods.forEach(function (mod) {
result[mod.name] = true;
});

this.body = result;
};

exports.listAllModuleNames = function *() {
Expand Down
2 changes: 1 addition & 1 deletion proxy/module.js
Original file line number Diff line number Diff line change
Expand Up @@ -444,7 +444,7 @@ LIST_SINCE_SQLS.push(multiline(function () {/*
*/}));
LIST_SINCE_SQLS.push(multiline(function () {/*
SELECT
name, package
name
FROM
module
WHERE
Expand Down
1 change: 0 additions & 1 deletion test/controllers/registry/module.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -555,7 +555,6 @@ describe('controllers/registry/module.test.js', function () {
res.body._updated.should.be.a.Number;
var keys = Object.keys(res.body);
keys.length.should.be.above(1);
res.body[keys[1]].dist.tarball.should.include('/download/');
done();
});
});
Expand Down

0 comments on commit ce5c979

Please sign in to comment.