Browse files

Fix submit response

  • Loading branch information...
1 parent 599a65a commit 70d8ae0b4c2f6e18ed38910e76ee703ec0362b91 @kriszyp committed Apr 1, 2011
Showing with 2 additions and 5 deletions.
  1. +2 −5 lib/model/package.js
View
7 lib/model/package.js
@@ -28,7 +28,7 @@ PackageModel = exports.Package = Model(packageStore, {
}else{
var npmResponse = {status: 200};
}
- when(npmResponse, function(npmResponse){
+ return when(npmResponse, function(npmResponse){
if(npmResponse.status < 300){
return {
__isJSGIResponse__: true,
@@ -45,7 +45,7 @@ PackageModel = exports.Package = Model(packageStore, {
});
},
query: function(){
- return packageStore.index;
+ return packageStore.index.slice(0).reverse();
},
get: function(id, meta){
if(id.indexOf('/') == -1){
@@ -267,19 +267,16 @@ function publish(url, asName, force){
print("Error " + error);
});
}else if(force){
- print("In force, checking to see if we are primary repository")
if(pckg.repositories[0].url == url){
// copy the latest info from the package.json if it is the primary repo
for(var i in packageData){
pckg[i] = packageData[i];
}
- print("Copied from package.json " + pckg.icon);
}
updateVersions(pckg, true).then(null, function(error){
print("Error " + error);
});
}
- print("icon " + pckg.icon);
packageStore.put(pckg);
return packageData.name;
});

0 comments on commit 70d8ae0

Please sign in to comment.