feat: add getAllUsers function and integrate user fetching in dashboard
This commit is contained in:
@@ -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 -->
|
||||
|
Reference in New Issue
Block a user