Use ES6 template string for route definition
This commit is contained in:
parent
967d9b76e6
commit
e131df601c
@ -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) => {
|
||||
|
Loading…
Reference in New Issue
Block a user