Manage users on admin panel
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
use crate::routes::get_users;
|
||||
use crate::{
|
||||
authentication::AuthenticatedUser,
|
||||
routes::{AppError, get_max_page, get_subs, get_total_subs},
|
||||
@@ -45,6 +46,9 @@ pub async fn admin_dashboard(
|
||||
.await
|
||||
.context("Could not fetch total subscribers count from the database.")?;
|
||||
let max_page = get_max_page(count);
|
||||
let users = get_users(&connection_pool)
|
||||
.await
|
||||
.context("Could not fetch users")?;
|
||||
let template = DashboardTemplate {
|
||||
user,
|
||||
idempotency_key_1,
|
||||
@@ -53,6 +57,7 @@ pub async fn admin_dashboard(
|
||||
subscribers,
|
||||
current_page,
|
||||
max_page,
|
||||
users,
|
||||
};
|
||||
Ok(Html(template.render().unwrap()).into_response())
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user