mirror of
https://github.com/verdaccio/verdaccio.git
synced 2025-01-06 22:40:26 -05:00
Fixed unpublish
This commit is contained in:
parent
820ae3f27c
commit
277f1023c9
4 changed files with 12 additions and 4 deletions
|
@ -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);
|
||||||
|
|
|
@ -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);
|
||||||
|
|
|
@ -103,6 +103,7 @@ Storage.prototype.remove_package = function(name, callback) {
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
search.remove(name);
|
||||||
localList.remove(name);
|
localList.remove(name);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -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) {
|
||||||
|
|
Loading…
Reference in a new issue