Function update_user_pii

Source
pub async fn update_user_pii(
    pool: &Pool<MySql>,
    user_id: i64,
    first_name: Option<&str>,
    last_name: Option<&str>,
    full_name: Option<&str>,
) -> Result<()>
Expand description

Updates a user’s personal information.

This function updates the user’s personal information in the user_pii table.

§Arguments

  • pool - Database connection pool for executing the query
  • user_id - Unique identifier of the user
  • first_name - Optional new first name
  • last_name - Optional new last name
  • full_name - Optional new full name (can be generated if first and last are provided)

§Returns

  • Ok(()) - Successfully updated user PII
  • Err(anyhow::Error) - Failed to update user PII