Skip to content

Commit

Permalink
Remove unnecessary variables
Browse files Browse the repository at this point in the history
  • Loading branch information
rzats committed Dec 11, 2024
1 parent f673766 commit 20fd21f
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions src/components/dialogs/dataSources/COVIDcast.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,10 @@
export let id: string;
let api_key = '';
let data_source = '';
let signal = '';
let geo_type = '';
let geo_value = '';
let form_key = $apiKey;
let valid_key = true;
let dataSources: (LabelValue & { signals: string[] })[] = [];
Expand All @@ -37,12 +35,11 @@
};
function fetchMetadata() {
fetchCOVIDcastMeta(form_key).then((res) => {
fetchCOVIDcastMeta($apiKey).then((res) => {
if (res.length == 0) {
valid_key = false;
} else {
valid_key = true;
api_key = form_key; // API key is valid -> use it to fetch data later on
geoTypes = [...new Set(res.map((d) => d.geo_type))];
const byDataSource = new Map<string, LabelValue & { signals: string[] }>();
for (const row of res) {
Expand Down Expand Up @@ -70,10 +67,10 @@
});
export function importDataSet() {
return fetchCOVIDcastMeta(api_key).then((res) => {
return fetchCOVIDcastMeta($apiKey).then((res) => {
const meta = res.filter((row) => row.data_source === data_source && row.signal === signal);
const time_type = meta[0].time_type;
return importCOVIDcast({ data_source, signal, geo_type, geo_value, time_type, api_key });
return importCOVIDcast({ data_source, signal, geo_type, geo_value, time_type, api_key: $apiKey });
});
}
</script>
Expand Down

0 comments on commit 20fd21f

Please sign in to comment.