Skip to main content

account_delete

Function account_delete 

Source
async fn account_delete(
    __arg0: State<AppState>,
    __arg1: Path<String>,
    headers: HeaderMap,
    body: Option<Json<DeleteBody>>,
) -> Response
Expand description

POST /dashboard/api/accounts/{did}/delete

The hard delete: the row goes too, and the ledger is what is left. An account with children is refused unless the body asks for the subtree, which is taken deepest first — a parent is erased only once nothing beneath it is live, which is the rule Provisioner::require_no_live_children enforces underneath.

The server’s own account is refused before anything is taken. Every account the server created hangs beneath it, so walking its subtree would delete them all before the refusal reached the server itself.

kind, neverWrote and idleFor are conditions on every account it would take; see crate::dashboard_accounts::Keeping. They are checked for the whole subtree first, where one that fails refuses the delete. They are checked again for each account with its writes held off, so an account that wrote after it was listed stays. didbot account delete --never-wrote and the accounts panel’s bulk delete send all three.