Commit 11e0134c899a09447da141e9a219c4bf9824cae7

Authored by Wesnydy Ribeiro
1 parent fb27224d

Send national sign if regional sign does not exist

Showing 1 changed file with 6 additions and 1 deletions   Show diff stats
translate-api/controllers/bundle.js
... ... @@ -52,5 +52,10 @@ exports.show=function(req, res, next) {
52 52 */
53 53 var upperSign = req.params.sign.toUpperCase();
54 54 var bundle = path.join(settings.bundlesPath, upperPlatform, upperState, upperSign);
55   - res.sendFile(bundle);
  55 + res.sendFile(bundle, function(err) {
  56 + if(err) { // Can't send from regional repository.
  57 + bundle = path.join(settings.bundlesPath, upperPlatform, upperSign);
  58 + res.sendFile(bundle); // Try to send from national repository.
  59 + }
  60 + });
56 61 };
... ...