From d5fd4c2863354a8f1029a6828676ce7dd2a99070 Mon Sep 17 00:00:00 2001 From: Anish Sarkar <104695310+AnishSarkar22@users.noreply.github.com> Date: Wed, 4 Feb 2026 23:19:45 +0530 Subject: [PATCH] refactor: change page size parameter to -1 for fetching all documents in useDocuments hook --- surfsense_web/hooks/use-documents.ts | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/surfsense_web/hooks/use-documents.ts b/surfsense_web/hooks/use-documents.ts index 4d1f8f67c..99fb99e13 100644 --- a/surfsense_web/hooks/use-documents.ts +++ b/surfsense_web/hooks/use-documents.ts @@ -6,8 +6,6 @@ import { documentsApiService } from "@/lib/apis/documents-api.service"; import type { SyncHandle } from "@/lib/electric/client"; import { useElectricClient } from "@/lib/electric/context"; -const PAGE_SIZE = 100; - // Stable empty array to prevent infinite re-renders when no typeFilter is provided const EMPTY_TYPE_FILTER: DocumentTypeEnum[] = []; @@ -165,7 +163,7 @@ export function useDocuments( queryParams: { search_space_id: spaceId, page: 0, - page_size: PAGE_SIZE, + page_size: -1, // Fetch all documents ...(currentTypeFilter.length > 0 && { document_types: currentTypeFilter }), }, });