]> uap-core.de Git - note.git/commitdiff
fix incorrect filter in get_attachment_content main
authorOlaf Wintermann <olaf.wintermann@gmail.com>
Thu, 10 Sep 2026 15:39:28 +0000 (17:39 +0200)
committerOlaf Wintermann <olaf.wintermann@gmail.com>
Thu, 10 Sep 2026 15:39:28 +0000 (17:39 +0200)
application/backend/src/backend.rs

index a14eab82df63efc617f545cc7559592cf7591135..135404789e4b83dfdb500da60e539c274c065b3d 100644 (file)
@@ -953,7 +953,8 @@ impl BackendHandle {
         let backend = self.backend.clone();
         let cmd = Box::pin(async move {
             let result = async {
         let backend = self.backend.clone();
         let cmd = Box::pin(async move {
             let result = async {
-                attachmentcontent::Entity::find_by_id(attachment_id)
+                attachmentcontent::Entity::find()
+                    .filter(attachmentcontent::Column::AttachmentId.eq(attachment_id))
                     .one(&backend.db)
                     .await?
                     .ok_or(DbErr::RecordNotFound(format!("attachment {} not found", attachment_id)))
                     .one(&backend.db)
                     .await?
                     .ok_or(DbErr::RecordNotFound(format!("attachment {} not found", attachment_id)))