fmt
This commit is contained in:
parent
b711296460
commit
0fc287c768
2 changed files with 2 additions and 6 deletions
|
|
@ -125,10 +125,7 @@ async fn post_deny(State(state): State<AppState>, AxumPath(id): AxumPath<i64>) -
|
|||
}
|
||||
}
|
||||
|
||||
async fn post_destroy(
|
||||
State(state): State<AppState>,
|
||||
AxumPath(name): AxumPath<String>,
|
||||
) -> Response {
|
||||
async fn post_destroy(State(state): State<AppState>, AxumPath(name): AxumPath<String>) -> Response {
|
||||
match actions::destroy(&state.coord, &name).await {
|
||||
Ok(()) => Redirect::to("/").into_response(),
|
||||
Err(e) => error_response(&format!("destroy {name} failed: {e:#}")),
|
||||
|
|
|
|||
|
|
@ -98,8 +98,7 @@ pub async fn destroy(name: &str) -> Result<()> {
|
|||
}
|
||||
let dropin_dir = format!("/run/systemd/system/container@{container}.service.d");
|
||||
if std::path::Path::new(&dropin_dir).exists() {
|
||||
std::fs::remove_dir_all(&dropin_dir)
|
||||
.with_context(|| format!("remove {dropin_dir}"))?;
|
||||
std::fs::remove_dir_all(&dropin_dir).with_context(|| format!("remove {dropin_dir}"))?;
|
||||
}
|
||||
Ok(())
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue