|
@@ -23,6 +23,7 @@ use axum::extract::Query;
|
|
|
use axum::{Json, Router};
|
|
|
#[cfg(not(target_os = "wasi"))]
|
|
|
use axum::http::Method;
|
|
|
+use axum::response::{IntoResponse, Response};
|
|
|
#[cfg(not(target_os = "wasi"))]
|
|
|
use axum::routing::{get, post};
|
|
|
#[cfg(not(target_os = "wasi"))]
|
|
@@ -395,9 +396,9 @@ struct GetEmailQuery {
|
|
|
id: String,
|
|
|
}
|
|
|
#[cfg(not(target_os = "wasi"))]
|
|
|
-async fn get_email_handle(Query(params): Query<GetEmailQuery>) -> Json<String> {
|
|
|
+async fn get_email_handle(Query(params): Query<GetEmailQuery>) -> Response {
|
|
|
let result: String = get_email(params.id).await;
|
|
|
- Json(result)
|
|
|
+ result.into_response()
|
|
|
}
|
|
|
|
|
|
#[cfg(not(target_os = "wasi"))]
|