diff --git a/frontend/_main page/pojedynczy_turniej/app.js b/frontend/_main page/pojedynczy_turniej/app.js
index ea49991..dd8b14d 100644
--- a/frontend/_main page/pojedynczy_turniej/app.js
+++ b/frontend/_main page/pojedynczy_turniej/app.js
@@ -1,4 +1,6 @@
-function showTournaments() {
+let tourId = localStorage.getItem("myElement")
+
+async function showTournaments() {
let url = 'https://dragonmaster.pl/inz/tournaments';
try {
let res = await fetch(url);
@@ -6,6 +8,55 @@ function showTournaments() {
} catch (error) {
console.log(error);
}
+}
+
+// async function renderTournaments() {
+// let tournaments = await showTournaments();
+// let html = '';
+// tournaments[1]; (tournament => {
+// let htmlSegment = `
${tournament.id}`;
+// html += htmlSegment;
+// });
+
+// let container = document.querySelector('.form');
+// container.innerHTML = html;
+// }
+
+async function renderTournaments() {
let tournaments = await showTournaments();
- console.log(tournaments[1])
-}
\ No newline at end of file
+ let html = '';
+ tournaments.forEach(tournament => {
+ if (`${tournament.id}` == localStorage.getItem("tournamentId")) {
+ let htmlSegment = `
+
${tournament.name}
+
${tournament.places}
+
+
Wpisowe:
+ ${tournament.entryFee}
+
+
Ranga:
+ ${tournament.rang}
+
+
Kategorie:
+ ${tournament.categotry}
+
+
Zapisy do:
+ ${tournament.to}
+
+
Czy rankingowy:
+ ${tournament.rang}
+
+
Dyrektor turnieju:
+ ${tournament.director}
+
+
Dodatkowe informacje
+ ${tournament.additionalInformations}
+
+ `;
+ html += htmlSegment;
+ }
+ });
+
+ let container = document.querySelector('.form');
+ container.innerHTML = html;
+}
diff --git a/frontend/_main page/pojedynczy_turniej/index.html b/frontend/_main page/pojedynczy_turniej/index.html
index 7fd840f..7796167 100644
--- a/frontend/_main page/pojedynczy_turniej/index.html
+++ b/frontend/_main page/pojedynczy_turniej/index.html
@@ -7,16 +7,19 @@
Padel Tournaments System
+
-
+