refactor: clean up unused code and improve conditionals in various modules

This commit is contained in:
GW_MC
2026-07-18 04:59:42 +00:00
parent 83037f3ee2
commit 076e87695d
11 changed files with 35 additions and 81 deletions

View File

@@ -33,10 +33,10 @@ pub async fn update_agent_handler(
Path(id): Path<uuid::Uuid>,
Json(body): Json<UpdateAgentRequest>,
) -> Result<impl IntoResponse, AppError> {
if let Some(ref name) = body.name {
if name.trim().is_empty() {
return Err(AppError::BadRequest("name must not be empty".to_string()));
}
if let Some(ref name) = body.name
&& name.trim().is_empty()
{
return Err(AppError::BadRequest("name must not be empty".to_string()));
}
let rec = UpdateAgentRecord {