From e6dc1193571b783b2fd82b7f32f5dc898b9df66d Mon Sep 17 00:00:00 2001 From: Mercurio <47455213+NotLugozzi@users.noreply.github.com> Date: Sat, 31 May 2025 21:52:28 +0200 Subject: [PATCH] Fix error handling in list_users and clean up comments in UpdateRole and UpdateQuota structs --- api/src/admin.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/api/src/admin.rs b/api/src/admin.rs index 84c1e89..85f50a8 100644 --- a/api/src/admin.rs +++ b/api/src/admin.rs @@ -17,7 +17,7 @@ pub async fn list_users(pool: &State, user: AuthenticatedUser) -> Result ) .fetch_all(pool.inner()) .await - .map_err(|_| Status::InternalServerError)?; // Fixed error handling + .map_err(|_| Status::InternalServerError)?; Ok(Json(users)) } @@ -25,7 +25,7 @@ pub async fn list_users(pool: &State, user: AuthenticatedUser) -> Result #[derive(Deserialize)] pub struct UpdateRole { pub user_id: i32, - pub new_role: String, // e.g. "admin" or "user" + pub new_role: String, } #[post("/user/role", data = "")] @@ -62,7 +62,7 @@ pub async fn update_role(pool: &State, user: AuthenticatedUser, data: Js #[derive(Deserialize)] pub struct UpdateQuota { pub user_id: i32, - pub quota: i64, // in bytes + pub quota: i64, } #[post("/user/quota", data = "")]