refactoring

This commit is contained in:
Frank Knoll
2024-04-24 14:28:02 +02:00
parent b0ec2683bc
commit 3d2e0405a3
2 changed files with 4 additions and 3 deletions

View File

@@ -1,8 +1,8 @@
class CompanyByBatchcodeProvider { class CompanyByBatchcodeProvider {
static getCompany(batchcode) { static getCompany(batchcode) {
return fetch(`data/histograms/Global/${batchcode}.json`) return HistoDescrsProvider
.then(response => response.json()) .getHistoDescrs(batchcode)
.then(histoDescrs => histoDescrs.Company); .then(histoDescrs => histoDescrs.Company);
} }
} }

View File

@@ -1,6 +1,7 @@
class HistoDescrsProvider { class HistoDescrsProvider {
static getHistoDescrs(batchcode) { static getHistoDescrs(batchcode) {
return fetch(`data/histograms/Global/${batchcode}.json`).then(response => response.json()) return fetch(`data/histograms/Global/${batchcode}.json`)
.then(response => response.json())
} }
} }