feat: add getAllUsers function and integrate user fetching in dashboard

This commit is contained in:
2025-06-30 20:23:08 +02:00
parent c165a0f71b
commit 0bae4d3c01
3 changed files with 104 additions and 1 deletions

View File

@@ -227,6 +227,16 @@
Delete User
</button>
</div>
<div class="col-sm">
<button
type="button"
onclick="callFunc('fetchAllUsers')"
class="btn btn-info w-100"
>
Fetch all Users
</button>
</div>
</div>
</form>
</div>
@@ -239,6 +249,37 @@
</p>
</div>
</div>
<div class="user-table">
<h4 class="mt-5 mb-3">All Users</h4>
<!-- Table to display all users -->
<table class="table">
<thead>
<tr>
<th scope="col">id</th>
<th scope="col">Username</th>
<th scope="col">First name</th>
<th scope="col">Last name</th>
<th scope="col">E-Mail</th>
<th scope="col">Password</th>
<th scope="col">Created</th>
</tr>
</thead>
<tbody class="table-group-divider">
<% users.forEach(user => { %>
<tr>
<td><%= user.id %></td>
<td><%= user.username %></td>
<td><%= user.first_name %></td>
<td><%= user.last_name %></td>
<td><%= user.email %></td>
<td><%= user.password %></td>
<td><%= user.created.toISOString() %></td>
</tr>
<% }) %>
</tbody>
</table>
</div>
</div>
<!-- Bootstrap JS Bundle -->