Brought back newsletter form on admin page

This commit is contained in:
Alphonse Paix
2025-09-18 18:40:03 +02:00
parent 066c2b8252
commit ebae511a12
5 changed files with 85 additions and 16 deletions

View File

@@ -10,16 +10,19 @@ use uuid::Uuid;
#[template(path = "../templates/dashboard.html")]
struct DashboardTemplate {
username: String,
idempotency_key: String,
idempotency_key_1: String,
idempotency_key_2: String,
}
pub async fn admin_dashboard(
Extension(AuthenticatedUser { username, .. }): Extension<AuthenticatedUser>,
) -> Response {
let idempotency_key = Uuid::new_v4().to_string();
let idempotency_key_1 = Uuid::new_v4().to_string();
let idempotency_key_2 = Uuid::new_v4().to_string();
let template = DashboardTemplate {
username,
idempotency_key,
idempotency_key_1,
idempotency_key_2,
};
Html(template.render().unwrap()).into_response()
}