diff options
author | Adrián Oliva <adrian.oliva@cimat.mx> | 2023-05-29 21:51:07 -0600 |
---|---|---|
committer | Adrián Oliva <adrian.oliva@cimat.mx> | 2023-05-29 21:51:07 -0600 |
commit | 82a11efa31f0a0d259e089e702f58dd9c141ed02 (patch) | |
tree | 6b0289fc54bb1c43715289b580bba4212faf1f4d /src/main/java/com/encora/Main.java | |
parent | 1f192c7ad1a7c3854efa5595321783e5b1a3fe81 (diff) | |
download | ToDo-App-BE-82a11efa31f0a0d259e089e702f58dd9c141ed02.tar.gz ToDo-App-BE-82a11efa31f0a0d259e089e702f58dd9c141ed02.zip |
New get function and sorting problems.
Get function for filtered to dos. Sorting can now compare null objects.
Reordered sorting because of a Concurrent Modification Exception.
Diffstat (limited to 'src/main/java/com/encora/Main.java')
-rw-r--r-- | src/main/java/com/encora/Main.java | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/src/main/java/com/encora/Main.java b/src/main/java/com/encora/Main.java index 7793be9..ea3a2a4 100644 --- a/src/main/java/com/encora/Main.java +++ b/src/main/java/com/encora/Main.java @@ -6,10 +6,7 @@ import org.springframework.data.domain.Sort; import org.springframework.http.HttpStatus; import org.springframework.web.bind.annotation.*; -import java.util.Collections; -import java.util.Date; -import java.util.List; -import java.util.Objects; +import java.util.*; @SpringBootApplication @RestController @@ -215,7 +212,7 @@ public class Main { } final int pageSize = 10; - List<ToDos> myToDos = toDosRepository.filteredToDos; + List<ToDos> myToDos = toDosRepository.getFilteredToDos(); int fromIndex = (page - 1) * pageSize; if (myToDos.size() <= fromIndex) { |