✨ Adds deleting logins
Signed-off-by: Ash Svitan <selfsigned-ash@proton.me>
This commit is contained in:
+12
-1
@@ -25,6 +25,7 @@ pub struct Items {
|
||||
pub struct Item {
|
||||
pub id: String,
|
||||
pub content: ItemContent,
|
||||
pub state: String,
|
||||
}
|
||||
|
||||
#[derive(Deserialize, Debug, Clone)]
|
||||
@@ -107,7 +108,9 @@ pub fn get_logins(items: Items) -> Vec<LoginItem> {
|
||||
.items
|
||||
.iter()
|
||||
.filter(|item| {
|
||||
if let None = item.content.content.login {
|
||||
if item.state.to_lowercase() != "active" {
|
||||
false
|
||||
} else if let None = item.content.content.login {
|
||||
false
|
||||
} else {
|
||||
true
|
||||
@@ -154,3 +157,11 @@ pub fn create(vault: &String, title: String, user: String, password: String) {
|
||||
));
|
||||
println!("> {}", output);
|
||||
}
|
||||
|
||||
pub fn trash(vault: &String, id: String) {
|
||||
let output = sh::sh(format!(
|
||||
"{} item trash --vault-name '{}' --item-id '{}'",
|
||||
EXECUTABLE, vault, id
|
||||
));
|
||||
println!("> {}", output);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user