commit 004c4a4e652f76b01148918a546bd31f7224d4ea
Author: Vojtěch Bartička <aitakaitov@gmail.com>
Date:   Mon May 16 19:26:56 2022 +0200

    Removed paging from GET /documents

diff --git a/Backend/Backend/Controllers/DocumentController.cs b/Backend/Backend/Controllers/DocumentController.cs
index 2a75c6a..17b1aea 100644
--- a/Backend/Backend/Controllers/DocumentController.cs
+++ b/Backend/Backend/Controllers/DocumentController.cs
@@ -30,7 +30,7 @@ public class DocumentController : Common.CommonControllerBase
     [Authorize(Models.Enums.ERole.ADMINISTRATOR)]
     [ProducesResponseType((int)HttpStatusCode.OK)]
     [ProducesResponseType((int)HttpStatusCode.Forbidden)]
-    public ActionResult<DocumentListResponse> GetDocuments([FromServices] ClientInfo clientInfo, [FromQuery] int pageIndex, [FromQuery] int pageSize)
+    public ActionResult<DocumentListResponse> GetDocuments([FromServices] ClientInfo clientInfo)
     {
         if (clientInfo.LoggedUser == null)
         {
@@ -38,7 +38,7 @@ public class DocumentController : Common.CommonControllerBase
             return Problem();
         }
 
-        return documentService.GetDocuments(pageIndex, pageSize);
+        return documentService.GetDocuments();
     }
 
     [HttpPost("/documents")]
diff --git a/Backend/BackendTesting/DocumentManagementTesting.cs b/Backend/BackendTesting/DocumentManagementTesting.cs
index 868c786..144271b 100644
--- a/Backend/BackendTesting/DocumentManagementTesting.cs
+++ b/Backend/BackendTesting/DocumentManagementTesting.cs
@@ -82,7 +82,7 @@ namespace BackendTesting
             }
 
 
-            var documents = DS.GetDocuments(index, numberOfDocs);
+            var documents = DS.GetDocuments(); //= DS.GetDocuments(index, numberOfDocs);
             Assert.IsNotNull(documents);
             Assert.AreEqual(documents.Documents.Count, numberOfDocs);
             for (int i = 0; i < numberOfDocs; i++)
diff --git a/Backend/Core/Services/DocumentService/DocumentServiceEF.cs b/Backend/Core/Services/DocumentService/DocumentServiceEF.cs
index aee25bc..d5cd380 100644
--- a/Backend/Core/Services/DocumentService/DocumentServiceEF.cs
+++ b/Backend/Core/Services/DocumentService/DocumentServiceEF.cs
@@ -113,29 +113,11 @@ namespace Core.Services.DocumentService
             databaseContext.SaveChanges();
         }
 
-        public DocumentListResponse GetDocuments(int pageIndex, int pageSize)
+        public DocumentListResponse GetDocuments()
         {
-            var firstIndex = pageIndex * pageSize;
-            var documents = databaseContext.Documents.Select(d => d).ToList();
-            var totalCount = documents.Count;
-            var pageCount = totalCount / pageSize;
-            if (pageCount == 0 && totalCount > 0)
-            {
-                pageCount = 1;
-            }
-
-            if (firstIndex > documents.Count - 1)
-            {
-                throw new Exception("Page index or page size too large");
-            }
-
-            if (firstIndex + pageSize > documents.Count - 1)
-            {
-                pageSize = documents.Count - firstIndex;
-            }
-
+            var documents = databaseContext.Documents.ToList();
             List<DocumentListInfo> documentInfos = new List<DocumentListInfo>();
-            foreach (var document in documents.GetRange(firstIndex, pageSize))
+            foreach (var document in documents)
             {
                 var annotatingUsers = databaseContext.Annotations
                     .Where(a => !(a is FinalAnnotation))
@@ -190,9 +172,6 @@ namespace Core.Services.DocumentService
 
             return new DocumentListResponse()
             {
-                PageCount = pageCount,
-                PageIndex = pageIndex,
-                TotalCount = totalCount,
                 Documents = documentInfos.OrderBy(di => di.Name).ToList()
             };
         }
diff --git a/Backend/Core/Services/DocumentService/IDocumentService.cs b/Backend/Core/Services/DocumentService/IDocumentService.cs
index fde4369..734146d 100644
--- a/Backend/Core/Services/DocumentService/IDocumentService.cs
+++ b/Backend/Core/Services/DocumentService/IDocumentService.cs
@@ -13,7 +13,7 @@ namespace Core.Services.DocumentService
     {
         public void AddDocuments(DocumentAddRequest request, Guid userId);
 
-        public DocumentListResponse GetDocuments(int pageIdnex, int pageSize);
+        public DocumentListResponse GetDocuments();
 
         public DocumentPreviewResponse GetDocumentPreview(Guid documentId);
         public void SetRequiredAnnotationsForDocuments(SetRequiredAnnotationsRequest request);
diff --git a/Backend/Models/Documents/DocumentListResponse.cs b/Backend/Models/Documents/DocumentListResponse.cs
index 1a80bd6..90b5f05 100644
--- a/Backend/Models/Documents/DocumentListResponse.cs
+++ b/Backend/Models/Documents/DocumentListResponse.cs
@@ -8,13 +8,6 @@ namespace Models.Documents;
 
 public class DocumentListResponse
 {
-    /** Total number of results */
-    public int TotalCount { get; set; }
-    /** Number of pages */
-    public int PageCount { get; set; }
-    /** Current page index */
-    public int PageIndex { get; set; }
-
     public List<DocumentListInfo> Documents { get; set; } = new();
 }
 
