Function soft_delete_user

Source
pub async fn soft_delete_user(pool: &Pool<MySql>, id: i64) -> Result<()>
Expand description

Soft deletes a user from the system.

This function marks a user as deleted by setting the deleted_at timestamp, but does not actually remove the record from the database.

§Arguments

  • pool - Database connection pool for executing the query
  • id - Unique identifier of the user to delete

§Returns

  • Ok(()) - Successfully marked the user as deleted
  • Err(anyhow::Error) - Failed to mark the user as deleted

§Notes

This operation is reversible by clearing the deleted_at field. The function preserves user data while making it inactive in the system.