some code formatting,

searchbar is now empty on reload
This commit is contained in:
J-Klinke
2024-06-25 09:14:12 +02:00
parent d96da1b1e7
commit eb2d6189a8
2 changed files with 9 additions and 9 deletions

View File

@@ -11,14 +11,13 @@ export function fetchQuery(fetchString) {
}
function parseContent(content) {
//TODO: method for parsing query results
console.log(content);
console.log(content); //TODO: remove
if (content.length === 0) {
searchSection.querySelector("#nothing-found ").classList.remove("hidden");
} else {
searchSection.querySelector("#nothing-found").classList.add("hidden");
const datasets = content.map(dataset => new Dataset(dataset));
console.log(datasets);
console.log(datasets); //TODO: remove
Array.from(searchSection.querySelectorAll(".datasets .dataset")).forEach(e => e.remove());
for (const dataset of datasets) {
searchSection.querySelector(".datasets").appendChild(dataset.createDatasetHTMLElement());