1
0
Fork 0
mirror of https://github.com/dani-garcia/vaultwarden.git synced 2025-07-24 13:00:39 +00:00

Remove dependent items when removing cipher

This commit is contained in:
Miroslav Prasil 2018-05-15 17:27:53 +01:00
commit 21c1ab7fda
6 changed files with 51 additions and 32 deletions

View file

@ -204,4 +204,10 @@ impl CollectionCipher {
_ => false,
}
}
pub fn delete_all_by_cipher(cipher_uuid: &str, conn: &DbConn) -> QueryResult<()> {
diesel::delete(ciphers_collections::table
.filter(ciphers_collections::cipher_uuid.eq(cipher_uuid))
).execute(&**conn).and(Ok(()))
}
}