From e131df601cc67c649e90f74ff695ba6b00298a52 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Garc=C3=ADa=20Aubert?= Date: Sun, 19 Nov 2017 14:05:20 +0100 Subject: [PATCH] Use ES6 template string for route definition --- lib/cartodb/controllers/analyses.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/cartodb/controllers/analyses.js b/lib/cartodb/controllers/analyses.js index 6c2465bc..fb75c633 100644 --- a/lib/cartodb/controllers/analyses.js +++ b/lib/cartodb/controllers/analyses.js @@ -10,7 +10,7 @@ module.exports = AnalysesController; AnalysesController.prototype.register = function (app) { app.get( - app.base_url_mapconfig + '/analyses/catalog', + `${app.base_url_mapconfig}/analyses/catalog`, cors(), userMiddleware, this.prepareContext, @@ -56,9 +56,11 @@ AnalysesController.prototype.prepareResponse = function () { const analysisIdToTable = tables.reduce((analysisIdToTable, table) => { const analysisId = table.relname.split('_')[2]; + if (analysisId && analysisId.length === 40) { analysisIdToTable[analysisId] = table; } + return analysisIdToTable; }, {}); @@ -66,6 +68,7 @@ AnalysesController.prototype.prepareResponse = function () { if (analysisIdToTable.hasOwnProperty(analysis.node_id)) { analysis.table = analysisIdToTable[analysis.node_id]; } + return analysis; }) .sort((analysisA, analysisB) => {