Test suite refactoring to match new htmx HTML swapping in pages

This commit is contained in:
Alphonse Paix
2025-09-17 14:16:27 +02:00
parent 859247d900
commit b5f0f448d7
8 changed files with 91 additions and 163 deletions

View File

@@ -7,7 +7,8 @@ use crate::{routes::error_chain_fmt, templates::ErrorTemplate};
use askama::Template;
use axum::{
Json,
response::{Html, IntoResponse, Redirect, Response},
http::HeaderMap,
response::{Html, IntoResponse, Response},
};
pub use change_password::*;
pub use dashboard::*;
@@ -52,7 +53,11 @@ impl IntoResponse for AdminError {
}),
)
.into_response(),
AdminError::NotAuthenticated => Redirect::to("/login").into_response(),
AdminError::NotAuthenticated => {
let mut headers = HeaderMap::new();
headers.insert("HX-Redirect", "/login".parse().unwrap());
(StatusCode::OK, headers).into_response()
}
AdminError::ChangePassword(e) => {
let template = ErrorTemplate {
error_message: e.to_owned(),

View File

@@ -209,7 +209,6 @@ Click <a href=\"{}\">here</a> to confirm your subscription.",
}
#[derive(Debug, Deserialize)]
#[allow(dead_code)]
pub struct SubscriptionFormData {
email: String,
}