mirror of
https://github.com/bitwarden/cli
synced 2026-01-16 06:53:12 +00:00
Added --trash to delete cmd, added restore cmd
This commit is contained in:
@@ -66,6 +66,9 @@ export class ListCommand {
|
||||
|
||||
if (cmd.folderid != null || cmd.collectionid != null || cmd.organizationid != null) {
|
||||
ciphers = ciphers.filter((c) => {
|
||||
if (cmd.trash && !c.isDeleted) {
|
||||
return false;
|
||||
}
|
||||
if (cmd.folderid != null) {
|
||||
if (cmd.folderid === 'notnull' && c.folderId != null) {
|
||||
return true;
|
||||
@@ -100,10 +103,12 @@ export class ListCommand {
|
||||
}
|
||||
return false;
|
||||
});
|
||||
} else if (cmd.search == null || cmd.search.trim() === '') {
|
||||
ciphers = ciphers.filter((c) => (cmd.trash || false) === c.isDeleted);
|
||||
}
|
||||
|
||||
if (cmd.search != null && cmd.search.trim() !== '') {
|
||||
ciphers = this.searchService.searchCiphersBasic(ciphers, cmd.search);
|
||||
ciphers = this.searchService.searchCiphersBasic(ciphers, cmd.search, cmd.trash || false);
|
||||
}
|
||||
|
||||
const res = new ListResponse(ciphers.map((o) => new CipherResponse(o)));
|
||||
|
||||
Reference in New Issue
Block a user