Skip to main content

delete_account

Function delete_account 

Source
pub async fn delete_account(
    __arg0: State<DB>,
    __arg1: Json<DeleteAccountRequest>,
) -> (StatusCode, Json<AuthTokenResponse>)
Expand description

Handles user account deletion requests

§Arguments

  • State(db) - Shared state containing the database connection
  • Json(payload) - The account deletion request payload containing username/email, password, and user ID

§Returns

  • (StatusCode, Json<AuthTokenResponse>) - The HTTP status code and JSON response indicating success or failure of the account deletion

§Example

let payload = DeleteAccountRequest {
    username_or_email: "john_doe",
    password: "secret_password",
    user_id: "user_id"
};