data display on clientSide

This commit is contained in:
tokslaw7
2025-06-22 17:12:32 -04:00
parent 54e6103dde
commit 58384964ba
3 changed files with 1053 additions and 39 deletions
+17 -9
View File
@@ -16,19 +16,27 @@ async function fetchAndDisplayData() {
dataContainer.textContent = 'No data found';
return;
}
// Create HTML for the data
const html = `
<ul>
${data.map(item => `
<li>
<h2>${item.name}</h2>
<strong>Role: </strong>${item.role}<br>
<strong>Email: </strong>${item.email}<br>
</li>`
).join('')}
</ul>
`
<li>
<h2>${item.name}</h2>
<strong>Role:</strong> ${item.role}<br>
<strong>Email:</strong> ${item.email}<br>
<strong>Username:</strong> ${item.username}<br>
<strong>UUID:</strong> ${item.userId}<br>
<strong>Avatar:</strong>${item.avatar}<br>
<strong>Initial Password:</strong> ${item.password}<br>
<strong>Birthdate:</strong> ${new Date(item.birthdate).toDateString()}<br>
<strong>Profile Bio:</strong> ${item.profile?.bio || 'N/A'}<br><br>
<ul>
</ul>
</li>
`).join('')}
</ul>
`
dataContainer.innerHTML = html;
} catch (error) {