Can define network filters

This commit is contained in:
2024-01-02 18:56:16 +01:00
parent 2b145ebeff
commit d4ef389852
11 changed files with 349 additions and 43 deletions

View File

@ -112,10 +112,15 @@ pub async fn update(
id: web::Path<SingleVMUUidReq>,
req: web::Json<VMInfo>,
) -> HttpResult {
let mut domain = req.0.as_tomain().map_err(|e| {
log::error!("Failed to extract domain info! {e}");
HttpResponse::BadRequest().json(format!("Failed to extract domain info! {e}"))
})?;
let mut domain = match req.0.as_tomain() {
Ok(d) => d,
Err(e) => {
log::error!("Failed to extract domain info! {e}");
return Ok(
HttpResponse::BadRequest().json(format!("Failed to extract domain info! {e}"))
);
}
};
domain.uuid = Some(id.uid);
if let Err(e) = client.update_domain(req.0, domain).await {