Merge remote-tracking branch 'origin/main' into 95-fix-home-screen-account-button-ui

This commit is contained in:
2024-11-17 17:38:29 -05:00
48 changed files with 1829 additions and 148 deletions

View File

@ -128,3 +128,15 @@ pub async fn get_user(username_or_email: String) -> Result<Option<User>, ServerF
Ok(user)
}
#[server(endpoint = "get_user_by_id")]
pub async fn get_user_by_id(user_id: i32) -> Result<Option<User>, ServerFnError> {
let mut user = find_user_by_id(user_id).await?;
// Remove the password hash before returning the user
if let Some(user) = user.as_mut() {
user.password = None;
}
Ok(user)
}