diff options
Diffstat (limited to 'src/db/models/cipher.rs')
-rw-r--r-- | src/db/models/cipher.rs | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/db/models/cipher.rs b/src/db/models/cipher.rs index e67ea0fd..db0db473 100644 --- a/src/db/models/cipher.rs +++ b/src/db/models/cipher.rs @@ -182,6 +182,13 @@ impl Cipher { Ok(()) } + pub fn delete_all_by_user(user_uuid: &str, conn: &DbConn) -> QueryResult<()> { + for cipher in Self::find_owned_by_user(user_uuid, &conn) { + cipher.delete(&conn)?; + } + Ok(()) + } + pub fn move_to_folder(&self, folder_uuid: Option<String>, user_uuid: &str, conn: &DbConn) -> Result<(), &str> { match self.get_folder_uuid(&user_uuid, &conn) { None => { |