refactor: clean up unused code and improve conditionals in various modules
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user