1
0
Fork 0
mirror of https://github.com/dani-garcia/vaultwarden.git synced 2025-06-09 20:43:53 +00:00

Account for removing existing collections first

This commit is contained in:
Stephen 2025-05-16 09:18:58 -04:00
parent 4c42a7e64c
commit 70676a9c23

View file

@ -783,6 +783,10 @@ async fn post_bulk_collections(
err!("Cipher is not write accessible")
}
// If the request is for mass adding collections, we need remove the cipher from all collections first.
if (!data.remove_collections) {
CollectionCipher::delete_all_by_cipher(&cipher.uuid, &mut conn).await?;
}
for collection in &data.collection_ids {
match Collection::find_by_uuid_and_org(collection, &data.organization_id, &mut conn).await {
None => err!("Invalid collection ID provided"),