Skip to content

Commit

Permalink
Change naming in fallbacks for more clarity
Browse files Browse the repository at this point in the history
  • Loading branch information
pbazydlo committed Mar 10, 2017
1 parent 5f6b306 commit d9fed88
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
10 changes: 5 additions & 5 deletions src/registry/routes/component-info.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,14 +72,14 @@ function componentInfo(err, req, res, component) {

module.exports = function(conf, repository){
return function(req, res){
repository.getComponent(req.params.componentName, req.params.componentVersion, function(localRegistryError, localComponent){
if(localRegistryError && conf.fallbackRegistryUrl) {
return getComponentFallback.getComponentInfo(conf, req, res, localRegistryError, function(error, component){
componentInfo(error, req, res, component);
repository.getComponent(req.params.componentName, req.params.componentVersion, function(registryError, component){
if(registryError && conf.fallbackRegistryUrl) {
return getComponentFallback.getComponentInfo(conf, req, res, registryError, function(fallbackError, fallbackComponent){
componentInfo(fallbackError, req, res, fallbackComponent);
});
}

componentInfo(localRegistryError, req, res, localComponent);
componentInfo(registryError, req, res, component);
});
};
};
10 changes: 5 additions & 5 deletions src/registry/routes/component-preview.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,15 @@ function componentPreview(err, req, res, component) {
module.exports = function(conf, repository){
return function(req, res){

repository.getComponent(req.params.componentName, req.params.componentVersion, function(localRegistryError, localComponent){
repository.getComponent(req.params.componentName, req.params.componentVersion, function(registryError, component){

if(localRegistryError && conf.fallbackRegistryUrl) {
return getComponentFallback.getComponentPreview(conf, req, res, localRegistryError, function(error, component){
componentPreview(error, req, res, component);
if(registryError && conf.fallbackRegistryUrl) {
return getComponentFallback.getComponentPreview(conf, req, res, registryError, function(fallbackError, fallbackComponent){
componentPreview(fallbackError, req, res, fallbackComponent);
});
}

componentPreview(localRegistryError, req, res, localComponent);
componentPreview(registryError, req, res, component);

});
};
Expand Down

0 comments on commit d9fed88

Please sign in to comment.