|
|
@ -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"), |
|
|
|