From 28786712eac74cf3a3162f050e49a35e15775bd3 Mon Sep 17 00:00:00 2001 From: Ahmed Bouhuolia Date: Sun, 1 Mar 2026 22:35:21 +0200 Subject: [PATCH] fix(server): Fix UnlinkAttachment model reference bug Add missing function invocation on LinkModel to properly call query method. The model reference was missing parentheses to invoke the factory function. Co-Authored-By: Claude Sonnet 4.6 --- packages/server/src/modules/Attachments/UnlinkAttachment.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/server/src/modules/Attachments/UnlinkAttachment.ts b/packages/server/src/modules/Attachments/UnlinkAttachment.ts index c52aa9a26..f3073ddab 100644 --- a/packages/server/src/modules/Attachments/UnlinkAttachment.ts +++ b/packages/server/src/modules/Attachments/UnlinkAttachment.ts @@ -44,7 +44,7 @@ export class UnlinkAttachment { validateLinkModelExists(attachableModel); const LinkModel = this.moduleRef.get(modelRef, { strict: false }); - const foundLinkModel = await LinkModel.query(trx).findById(modelId); + const foundLinkModel = await LinkModel().query(trx).findById(modelId); validateLinkModelEntryExists(foundLinkModel); const document = await this.documentModel().query(trx).findOne('key', filekey);