From d9fed8891670edc7aec4a3aea2fe8b7ab3bbe4f8 Mon Sep 17 00:00:00 2001 From: Piotr Bazydlo Date: Fri, 10 Mar 2017 10:16:00 +0000 Subject: [PATCH] Change naming in fallbacks for more clarity --- src/registry/routes/component-info.js | 10 +++++----- src/registry/routes/component-preview.js | 10 +++++----- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/registry/routes/component-info.js b/src/registry/routes/component-info.js index 3be55d9a2..32e9512a2 100644 --- a/src/registry/routes/component-info.js +++ b/src/registry/routes/component-info.js @@ -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); }); }; }; \ No newline at end of file diff --git a/src/registry/routes/component-preview.js b/src/registry/routes/component-preview.js index 7d779a2ca..a915bec7f 100644 --- a/src/registry/routes/component-preview.js +++ b/src/registry/routes/component-preview.js @@ -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); }); };