fix: delete attachments by used_for.id and add corresponding index

This commit is contained in:
Paul Makles
2024-09-29 15:05:56 +01:00
parent 3080ec1f5a
commit cbf9e81256
4 changed files with 30 additions and 2 deletions

View File

@@ -261,7 +261,7 @@ impl AbstractChannels for MongoDb {
// Delete associated attachments
self.delete_many_attachments(doc! {
"object_id": &id
"used_for.id": &id
})
.await?;