Files
HowBadIsMyBatch/docs/HistoDescrsProvider.js
frankknoll f2e00505a7 refactoring
2023-04-03 00:15:00 +02:00

11 lines
412 B
JavaScript

class HistoDescrsProvider {
static getHistoDescrs(batchcode) {
return fetch(`data/histograms/Global/${batchcode}.json`)
.then(response => response.json())
.then(histoDescrs => {
histoDescrs.histograms.sort((histoDescr1, histoDescr2) => histoDescr1.batchcodes.length - histoDescr2.batchcodes.length);
return histoDescrs;
});
}
}