mirror of
https://github.com/dani-garcia/vaultwarden.git
synced 2025-08-28 21:44:49 +00:00
Account for removing existing collections first
This commit is contained in:
parent
4c42a7e64c
commit
70676a9c23
1 changed files with 4 additions and 0 deletions
|
@ -783,6 +783,10 @@ async fn post_bulk_collections(
|
||||||
err!("Cipher is not write accessible")
|
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 {
|
for collection in &data.collection_ids {
|
||||||
match Collection::find_by_uuid_and_org(collection, &data.organization_id, &mut conn).await {
|
match Collection::find_by_uuid_and_org(collection, &data.organization_id, &mut conn).await {
|
||||||
None => err!("Invalid collection ID provided"),
|
None => err!("Invalid collection ID provided"),
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue