]> git.ipfire.org Git - thirdparty/paperless-ngx.git/commitdiff
Fix: set larger page size for abstract service getFew (#8920)
authorshamoon <4887959+shamoon@users.noreply.github.com>
Sun, 26 Jan 2025 20:25:50 +0000 (12:25 -0800)
committerGitHub <noreply@github.com>
Sun, 26 Jan 2025 20:25:50 +0000 (12:25 -0800)
src-ui/src/app/services/rest/abstract-paperless-service.spec.ts
src-ui/src/app/services/rest/abstract-paperless-service.ts

index 3bbd278b1ff37700b9f01a15a8597475f57e001f..79af8381d481c6800e5c7bea047789417aaf72fc 100644 (file)
@@ -101,13 +101,13 @@ export const commonAbstractPaperlessServiceTests = (endpoint, ServiceClass) => {
     test('should call appropriate api endpoint for get a few objects', () => {
       subscription = service.getFew([1, 2, 3]).subscribe()
       const req = httpTestingController.expectOne(
-        `${environment.apiBaseUrl}${endpoint}/?id__in=1,2,3&ordering=-id`
+        `${environment.apiBaseUrl}${endpoint}/?id__in=1,2,3&ordering=-id&page_size=1000`
       )
       expect(req.request.method).toEqual('GET')
       req.flush([])
       subscription = service.getFew([4, 5, 6], { foo: 'bar' }).subscribe()
       const req2 = httpTestingController.expectOne(
-        `${environment.apiBaseUrl}${endpoint}/?id__in=4,5,6&ordering=-id&foo=bar`
+        `${environment.apiBaseUrl}${endpoint}/?id__in=4,5,6&ordering=-id&page_size=1000&foo=bar`
       )
       expect(req2.request.method).toEqual('GET')
       req2.flush([])
index 363575344fa0d7b15cecd50cd805afc7b41c440e..ca1c4edadbb1765c10ca4315be6275a9a355cab9 100644 (file)
@@ -95,6 +95,7 @@ export abstract class AbstractPaperlessService<T extends ObjectWithId> {
     let httpParams = new HttpParams()
     httpParams = httpParams.set('id__in', ids.join(','))
     httpParams = httpParams.set('ordering', '-id')
+    httpParams = httpParams.set('page_size', 1000)
     for (let extraParamKey in extraParams) {
       if (extraParams[extraParamKey] != null) {
         httpParams = httpParams.set(extraParamKey, extraParams[extraParamKey])