async function showTournaments() { let url = 'https://dragonmaster.pl/inz/tournaments'; try { let res = await fetch(url); return await res.json(); } catch (error) { console.log(error); } } async function renderTournaments() { let tournaments = await showTournaments(); let html = ''; tournaments.forEach(tournament => { let htmlSegment = `

${tournament.name}

Propadel, Warszawa ${tournament.from} do ${tournament.to}
`; html += htmlSegment; }); let container = document.querySelector('.tournament-list'); container.innerHTML = html; }