Files
HowBadIsMyBatch/docs/HistoDescrsProvider.js
2023-04-02 20:14:47 +02:00

12 lines
456 B
JavaScript

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