refactor forms to be more readable

This commit is contained in:
blek 2023-10-26 18:27:57 +10:00
parent 0cdf8fe7fc
commit c1220cac79
Signed by: blek
GPG Key ID: 14546221E3595D0C
1 changed files with 6 additions and 5 deletions

View File

@ -249,9 +249,10 @@ pub async fn upload(form: FormData, state: SharedState) -> Result<Box<dyn Reply>
}
pub fn get_routes(state: SharedState) -> impl Filter<Extract = impl Reply, Error = Rejection> + Clone {
warp::post().and(
warp::multipart::form()
.and(warp::any().map(move || state.clone()))
.and_then(upload)
warp::post()
.and(warp::multipart::form())
.and(
warp::any().map(move || state.clone())
)
.and_then(upload)
}