Skip to content

Commit 6ae99bf

Browse files
committed
URL PATH of Actions - Controller Methods Refactoring
1 parent 37a03cb commit 6ae99bf

File tree

4 files changed

+7
-5
lines changed

4 files changed

+7
-5
lines changed

etc/TODO.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,4 +86,4 @@ https://maven.apache.org/enforcer/enforcer-rules/dependencyConvergence.html
8686
https://www.baeldung.com/maven-enforcer-plugin
8787

8888
# 2.3.14
89-
Fixed #127
89+
Fixed #127, Fixed #127, Fixed #122

src/main/java/org/woehlke/simpleworklist/project/ProjectController.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import lombok.extern.slf4j.Slf4j;
44
import org.springframework.data.domain.Page;
55
import org.springframework.data.domain.Pageable;
6+
import org.springframework.data.domain.Sort;
67
import org.springframework.data.web.PageableDefault;
78
import org.springframework.stereotype.Controller;
89
import org.springframework.ui.Model;
@@ -45,7 +46,7 @@ public ProjectController(ProjectControllerService projectControllerService, Task
4546
@RequestMapping(path = "/{projectId}", method = RequestMethod.GET)
4647
public final String showProject(
4748
@PathVariable long projectId,
48-
@PageableDefault(sort = "orderIdProject") Pageable pageable,
49+
@PageableDefault(sort = "orderIdProject", direction = Sort.Direction.DESC) Pageable pageable,
4950
@RequestParam(required = false) String message,
5051
@RequestParam(required = false) boolean isDeleted,
5152
@ModelAttribute("userSession") UserSessionBean userSession,
@@ -185,7 +186,7 @@ public final String editProjectPost(
185186
@RequestMapping(path = "/{projectId}/delete", method = RequestMethod.GET)
186187
public final String deleteProject(
187188
@PathVariable("projectId") Project project,
188-
@PageableDefault(sort = "title") Pageable request,
189+
@PageableDefault(sort = "title", direction = Sort.Direction.DESC) Pageable request,
189190
@ModelAttribute("userSession") UserSessionBean userSession,
190191
Locale locale,
191192
Model model

src/main/java/org/woehlke/simpleworklist/project/ProjectRootController.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
import org.springframework.beans.factory.annotation.Autowired;
55
import org.springframework.data.domain.Page;
66
import org.springframework.data.domain.Pageable;
7+
import org.springframework.data.domain.Sort;
78
import org.springframework.data.web.PageableDefault;
89
import org.springframework.stereotype.Controller;
910
import org.springframework.ui.Model;
@@ -43,7 +44,7 @@ public ProjectRootController(
4344

4445
@RequestMapping(path="/root", method = RequestMethod.GET)
4546
public final String showRootProject(
46-
@PageableDefault(sort = "orderIdProject") Pageable pageable,
47+
@PageableDefault(sort = "orderIdProject", direction = Sort.Direction.DESC) Pageable pageable,
4748
@RequestParam(required = false) String message,
4849
@RequestParam(required = false) boolean isDeleted,
4950
@ModelAttribute("userSession") UserSessionBean userSession,

src/main/java/org/woehlke/simpleworklist/taskstate/TaskStateController.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ public TaskStateController(TaskStateService taskStateService, TaskControllerServ
3636

3737
@RequestMapping(path = "/inbox", method = RequestMethod.GET)
3838
public final String inbox(
39-
@PageableDefault(sort = "orderIdTaskState") Pageable pageable,
39+
@PageableDefault(sort = "orderIdTaskState", direction = Sort.Direction.DESC) Pageable pageable,
4040
@ModelAttribute("userSession") UserSessionBean userSession,
4141
Locale locale,
4242
Model model

0 commit comments

Comments
 (0)