More tests, not found page and dashboard fixes
When post was deleted, website shows a 404 page insead of an 500 page. Also made the dashboard empty page message more explicit.
This commit is contained in:
@@ -25,7 +25,7 @@ pub use unsubscribe::*;
|
||||
|
||||
use crate::{
|
||||
authentication::AuthError,
|
||||
templates::{InternalErrorTemplate, MessageTemplate, NotFoundTemplate},
|
||||
templates::{HtmlTemplate, InternalErrorTemplate, MessageTemplate, NotFoundTemplate},
|
||||
};
|
||||
|
||||
pub fn generate_token() -> String {
|
||||
@@ -155,9 +155,6 @@ impl From<AuthError> for AppError {
|
||||
}
|
||||
|
||||
pub async fn not_found() -> Response {
|
||||
(
|
||||
StatusCode::NOT_FOUND,
|
||||
Html(NotFoundTemplate.render().unwrap()),
|
||||
)
|
||||
.into_response()
|
||||
let template = HtmlTemplate(NotFoundTemplate);
|
||||
(StatusCode::NOT_FOUND, template).into_response()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user