From 8717d160ce4cc60eeeba33ccec61d57fd3b3dbf0 Mon Sep 17 00:00:00 2001 From: Tom Moor Date: Wed, 7 May 2025 20:36:56 -0400 Subject: [PATCH] fix: Backlinks are limited at 25 (#9150) --- app/stores/DocumentsStore.ts | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/app/stores/DocumentsStore.ts b/app/stores/DocumentsStore.ts index 13d249ccc8..1e29924ed9 100644 --- a/app/stores/DocumentsStore.ts +++ b/app/stores/DocumentsStore.ts @@ -279,19 +279,14 @@ export default class DocumentsStore extends Store { @action fetchBacklinks = async (documentId: string): Promise => { - const res = await client.post(`/documents.list`, { + const documents = await this.fetchAll({ backlinkDocumentId: documentId, }); - invariant(res?.data, "Document list not available"); - const { data } = res; runInAction("DocumentsStore#fetchBacklinks", () => { - data.forEach(this.add); - this.addPolicies(res.policies); - this.backlinks.set( documentId, - data.map((doc: Partial) => doc.id) + documents.map((doc) => doc.id) ); }); };