0
Fork 0
mirror of https://github.com/verdaccio/verdaccio.git synced 2025-01-06 22:40:26 -05:00

Fixed unpublish

This commit is contained in:
Brian Peacock 2014-05-08 16:48:15 -05:00
parent 820ae3f27c
commit 277f1023c9
4 changed files with 12 additions and 4 deletions

View file

@ -248,8 +248,10 @@ module.exports = function(config_hash) {
packages = []; packages = [];
var getData = function(i) { var getData = function(i) {
storage.get_package(results[i].ref, function(err, package) { storage.get_package(results[i].ref, function(err, entry) {
packages.push(package.versions[package['dist-tags'].latest]); if(entry) {
packages.push(entry.versions[entry['dist-tags'].latest]);
}
if(i >= results.length - 1) { if(i >= results.length - 1) {
res.send(packages); res.send(packages);

View file

@ -17,7 +17,7 @@ LocalList.prototype = {
this.sync(); this.sync();
} }
}, },
remove: function() { remove: function(name) {
var i = this.list.indexOf(name); var i = this.list.indexOf(name);
if(i != -1) { if(i != -1) {
this.list.splice(i, 1); this.list.splice(i, 1);

View file

@ -103,6 +103,7 @@ Storage.prototype.remove_package = function(name, callback) {
}); });
}); });
search.remove(name);
localList.remove(name); localList.remove(name);
} }

View file

@ -22,6 +22,11 @@ Search.prototype = {
author: package._npmUser.name author: package._npmUser.name
}); });
}, },
remove: function(name) {
this.index.remove({
id: name
});
},
reindex: function() { reindex: function() {
var self = this; var self = this;
this.storage.get_local(function(err, packages) { this.storage.get_local(function(err, packages) {