|
|
@ -83,11 +83,14 @@ async fn main() -> Result<(), sqlx::Error> { |
|
|
|
repo.save(&record).await?; |
|
|
|
repo.save(&record).await?; |
|
|
|
} else if command == "remove" { |
|
|
|
} else if command == "remove" { |
|
|
|
println!("Should remove \"{}\"", value); |
|
|
|
println!("Should remove \"{}\"", value); |
|
|
|
if let Ok(record) = repo.find_by_description(&value).await { |
|
|
|
match repo.find_by_description(&value).await { |
|
|
|
repo.delete(&record).await?; |
|
|
|
Ok(record) => { |
|
|
|
println!("Removed"); |
|
|
|
repo.delete(&record).await?; |
|
|
|
} else { |
|
|
|
println!("Removed"); |
|
|
|
println!("Label does not exist"); |
|
|
|
} |
|
|
|
|
|
|
|
Err(err) => { |
|
|
|
|
|
|
|
println!("Label does not exist: {:?}", err); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
Ok(()) |
|
|
|
Ok(()) |
|
|
|