1
0

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 <noreply@anthropic.com>
This commit is contained in:
Ahmed Bouhuolia
2026-03-01 22:35:21 +02:00
parent c29381bf69
commit 28786712ea
@@ -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);