make sure everything is wendered
This commit is contained in:
parent
fc26533460
commit
3dd25b2063
3 changed files with 8 additions and 19 deletions
|
@ -6,13 +6,14 @@ use http::StatusCode;
|
||||||
use julid::Julid;
|
use julid::Julid;
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
use sqlx::SqlitePool;
|
use sqlx::SqlitePool;
|
||||||
use templates::{SignupErrorPage, SignupPage};
|
|
||||||
|
|
||||||
use crate::{WatchDate, WatchError};
|
use crate::{WatchDate, Wender};
|
||||||
|
|
||||||
pub mod handlers;
|
pub mod handlers;
|
||||||
pub mod templates;
|
pub mod templates;
|
||||||
|
|
||||||
|
use templates::SignupErrorPage;
|
||||||
|
|
||||||
//-************************************************************************
|
//-************************************************************************
|
||||||
// Error types for user creation
|
// Error types for user creation
|
||||||
//-************************************************************************
|
//-************************************************************************
|
||||||
|
@ -178,10 +179,7 @@ impl IntoResponse for CreateInviteError {
|
||||||
StatusCode::OK,
|
StatusCode::OK,
|
||||||
SignupErrorPage("Sorry, invitations require an owner".to_string())
|
SignupErrorPage("Sorry, invitations require an owner".to_string())
|
||||||
.render()
|
.render()
|
||||||
.map_err(|e| {
|
.wender(),
|
||||||
tracing::error!("could not render create user error page, got {e}");
|
|
||||||
StatusCode::INTERNAL_SERVER_ERROR
|
|
||||||
}),
|
|
||||||
)
|
)
|
||||||
.into_response(),
|
.into_response(),
|
||||||
_ => (StatusCode::OK, format!("{self}")).into_response(),
|
_ => (StatusCode::OK, format!("{self}")).into_response(),
|
||||||
|
@ -199,10 +197,7 @@ impl IntoResponse for CreateUserError {
|
||||||
StatusCode::OK,
|
StatusCode::OK,
|
||||||
SignupErrorPage("Sorry, that invitation isn't valid.".to_string())
|
SignupErrorPage("Sorry, that invitation isn't valid.".to_string())
|
||||||
.render()
|
.render()
|
||||||
.map_err(|e| {
|
.wender(),
|
||||||
tracing::error!("could not render create user error page, got {e}");
|
|
||||||
StatusCode::INTERNAL_SERVER_ERROR
|
|
||||||
}),
|
|
||||||
)
|
)
|
||||||
.into_response(),
|
.into_response(),
|
||||||
_ => (StatusCode::OK, format!("{self}")).into_response(),
|
_ => (StatusCode::OK, format!("{self}")).into_response(),
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
use askama::Template;
|
use askama::Template;
|
||||||
use axum::{
|
use axum::{
|
||||||
extract::{Form, Path, State},
|
extract::{Form, Path, State},
|
||||||
http::StatusCode,
|
|
||||||
response::{IntoResponse, Redirect},
|
response::{IntoResponse, Redirect},
|
||||||
};
|
};
|
||||||
use http::HeaderValue;
|
use http::HeaderValue;
|
||||||
|
@ -14,8 +13,8 @@ use super::{
|
||||||
AddError, AddErrorKind, EditError, EditErrorKind, WatchesError,
|
AddError, AddErrorKind, EditError, EditErrorKind, WatchesError,
|
||||||
};
|
};
|
||||||
use crate::{
|
use crate::{
|
||||||
misc_util::empty_string_as_none, AuthSession, MyWatchesPage, ShowKind, Watch, WatchError,
|
misc_util::empty_string_as_none, AuthSession, MyWatchesPage, ShowKind, Watch, WatchQuest,
|
||||||
WatchQuest, Wender,
|
Wender,
|
||||||
};
|
};
|
||||||
|
|
||||||
//-************************************************************************
|
//-************************************************************************
|
||||||
|
@ -286,10 +285,7 @@ pub async fn get_watch(
|
||||||
user: auth.user,
|
user: auth.user,
|
||||||
}
|
}
|
||||||
.render()
|
.render()
|
||||||
.map_err(|e| {
|
.wender()
|
||||||
tracing::error!("could not render watch page, got {e}");
|
|
||||||
StatusCode::INTERNAL_SERVER_ERROR
|
|
||||||
})
|
|
||||||
.into_response()
|
.into_response()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -3,8 +3,6 @@ use http::StatusCode;
|
||||||
use julid::Julid;
|
use julid::Julid;
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
|
|
||||||
use crate::WatchError;
|
|
||||||
|
|
||||||
pub mod handlers;
|
pub mod handlers;
|
||||||
pub mod templates;
|
pub mod templates;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue