Test suite refactoring to match new htmx HTML swapping in pages
This commit is contained in:
@@ -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(),
|
||||
|
||||
@@ -209,7 +209,6 @@ Click <a href=\"{}\">here</a> to confirm your subscription.",
|
||||
}
|
||||
|
||||
#[derive(Debug, Deserialize)]
|
||||
#[allow(dead_code)]
|
||||
pub struct SubscriptionFormData {
|
||||
email: String,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user