diff options
Diffstat (limited to 'src/api/users.rs')
-rw-r--r-- | src/api/users.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/api/users.rs b/src/api/users.rs index 45ed195..7bea200 100644 --- a/src/api/users.rs +++ b/src/api/users.rs @@ -17,7 +17,7 @@ async fn load_batch(AuthorizedUser(_user): AuthorizedUser, Json(body): Json<User let users = User::from_user_ids(body.ids); let Ok(json) = serde_json::to_string(&users) else { - return ResponseCode::InternalServerError.msg("Failed to fetch users") + return ResponseCode::InternalServerError.text("Failed to fetch users") }; ResponseCode::Success.json(&json) @@ -37,11 +37,11 @@ impl Check for UserPageReqiest { async fn load_page(AuthorizedUser(_user): AuthorizedUser, Json(body): Json<UserPageReqiest>) -> Response { let Ok(users) = User::from_user_page(body.page) else { - return ResponseCode::InternalServerError.msg("Failed to fetch users") + return ResponseCode::InternalServerError.text("Failed to fetch users") }; let Ok(json) = serde_json::to_string(&users) else { - return ResponseCode::InternalServerError.msg("Failed to fetch users") + return ResponseCode::InternalServerError.text("Failed to fetch users") }; ResponseCode::Success.json(&json) @@ -50,7 +50,7 @@ async fn load_page(AuthorizedUser(_user): AuthorizedUser, Json(body): Json<UserP async fn load_self(AuthorizedUser(user): AuthorizedUser) -> Response { let Ok(json) = serde_json::to_string(&user) else { - return ResponseCode::InternalServerError.msg("Failed to fetch user") + return ResponseCode::InternalServerError.text("Failed to fetch user") }; ResponseCode::Success.json(&json) |