delete_user

Function delete_user 

Source
pub async fn delete_user(
    __arg0: Path<i16>,
    __arg1: State<Arc<AppState>>,
) -> Result<impl IntoResponse, (StatusCode, Json<Value>)>
Expand description

Deletes a user account from the system.

Only admins can delete users (enforced by middleware). The User account and all associated data is removed. Note: Tickets created by deleted users will have NULL user_id references.

§Arguments

  • Path(id): User ID to delete, extracted from URL path
  • State(data): Application state containing AppState for database access

§Returns

  • 204 No Content on successful deletion
  • 404 Not Found if user doesn’t exist
  • 500 Internal Server Error if database error occurs