Skip to content

Commit 8b7d350

Browse files
committed
only no-numerated MD analyses in options
1 parent 3960c46 commit 8b7d350

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

src/routes/projects/options/index.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -285,6 +285,18 @@ router.route('/').get(
285285
options[field] = counts;
286286
});
287287
}
288+
// This is the moment to do any last changes to the results
289+
// Here are the hardcodes to solve silly issues or not "good looking" numbers
290+
// Remove MD interaction-analyses with the numerated name
291+
const mdAnalysesKey = 'mds.analyses.name';
292+
const numeratedAnalysisPattern = /-[0-9]*$/;
293+
if (mdAnalysesKey in options) {
294+
const mdAnalyses = options[mdAnalysesKey];
295+
Object.keys(mdAnalyses).forEach(key => {
296+
// If it ends in '-xx' where xx is any number of numeric characters
297+
if (key.match(numeratedAnalysisPattern)) delete mdAnalyses[key];
298+
});
299+
}
288300
// LORE: We no longer sort the final response, this is now done by the client
289301
// LORE: You can not rely in objects order and returning everything as arrays is not efficient
290302
// Send all mined data

0 commit comments

Comments
 (0)