Skip to content

Commit

Permalink
Merge pull request #51 from w3geo/remove-getjson
Browse files Browse the repository at this point in the history
Recover from conflict resolution in #50
  • Loading branch information
ahocevar authored Sep 3, 2024
2 parents ae6de9d + 55343b7 commit 6016fd8
Showing 1 changed file with 0 additions and 43 deletions.
43 changes: 0 additions & 43 deletions src/composables/useLookUps.js
Original file line number Diff line number Diff line change
Expand Up @@ -141,49 +141,6 @@ export const lookup = shallowRef({
entzugstabelleBraugerste,
});

async function getJson(what) {
const response = await fetch(`data/${what}.json`);
const data = await response.json();
lookup.value[what] = data;

if (what === 'kulturen') {
kulturenItems.zwischen = [];
kulturenItems.alle = [];

for (let k = 0; k < data.length; k++) {
if (aussaatTypeFilter.zwischenU.includes(data[k].ID)) {
kulturenItems.zwischen.push({ value: data[k].ID, title: data[k].Kultur });
} else if (aussaatTypeFilter.zwischenG.includes(data[k].ID)) {
kulturenItems.zwischen.push({ value: data[k].ID, title: data[k].Kultur });
} else {
kulturenItems.alle.push({ value: data[k].ID, title: data[k].Kultur });
const alleFNA = data[k].Feldstücknutzungsart.split(';');
for (let f = 0; f < alleFNA.length; f++) {
if (kulturenItems[alleFNA[f]]) {
kulturenItems[alleFNA[f]].push({ value: data[k].ID, title: data[k].Kultur });
} else {
kulturenItems[alleFNA[f]] = [{ value: data[k].ID, title: data[k].Kultur }];
}
}
}
}
for (let k in kulturenItems) {
kulturenItems[k].splice(0, 0, { title: 'Keine', value: '' });
}
}
}

{
getJson('feldstücknutzungsarten');
getJson('bodenartenbodenschwere');
getJson('kulturen');
getJson('wirtschaftsdünger');
getJson('sekundärrohstoffe');
getJson('handelsdünger');
getJson('entzugstabelle-weizen');
getJson('entzugstabelle-braugerste');
}

/**
* @returns {{ lookup: import('vue').ShallowRef<Object> }}
*/
Expand Down

0 comments on commit 6016fd8

Please sign in to comment.