fix compile errer

This commit is contained in:
blek 2023-10-01 21:45:12 +10:00
parent ce8737b0f5
commit 4fdc213a05
Signed by: blek
GPG Key ID: 14546221E3595D0C
2 changed files with 6 additions and 4 deletions

View File

@ -52,7 +52,9 @@ pub async fn upload(form: FormData, state: SharedState) -> Result<Box<dyn Reply>
return Ok(Box::new( return Ok(Box::new(
warp::reply::with_status( warp::reply::with_status(
warp::reply::html( warp::reply::html(
BadActionReq {} BadActionReq {
env: state.env.clone()
}
.render() .render()
.map_err(|err| warp::reject::custom(HttpReject::AskamaError(err.into())))? .map_err(|err| warp::reject::custom(HttpReject::AskamaError(err.into())))?
), ),

View File

@ -14,13 +14,13 @@ use super::{state::SharedState, rejection::HttpReject};
#[derive(Template)] #[derive(Template)]
#[template( path = "index.html" )] #[template( path = "index.html" )]
pub struct Index { pub struct Index {
env: Env pub env: Env
} }
#[derive(Template)] #[derive(Template)]
#[template( path = "bad_action_req.html" )] #[template( path = "bad_action_req.html" )]
pub struct BadActionReq { pub struct BadActionReq {
env: Env pub env: Env
} }
#[derive(Template)] #[derive(Template)]
@ -28,7 +28,7 @@ pub struct BadActionReq {
#[allow(dead_code)] #[allow(dead_code)]
pub struct Uploaded { pub struct Uploaded {
file: String, file: String,
env: Env pub env: Env
} }