diff options
author | Tyler Murphy <tylermurphy534@gmail.com> | 2023-01-28 02:51:34 -0500 |
---|---|---|
committer | Tyler Murphy <tylermurphy534@gmail.com> | 2023-01-28 02:51:34 -0500 |
commit | c01b8b8c90fa762f25bf52437611643e3ca16e5a (patch) | |
tree | c93293c5c074a03808cdd4b85cdf6001f2f17dd6 /src/api/users.rs | |
parent | rusty boio finished (diff) | |
download | xssbook-c01b8b8c90fa762f25bf52437611643e3ca16e5a.tar.gz xssbook-c01b8b8c90fa762f25bf52437611643e3ca16e5a.tar.bz2 xssbook-c01b8b8c90fa762f25bf52437611643e3ca16e5a.zip |
fix rerendering logout button, console page
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) |