diff --git a/data.mv.db b/data.mv.db index d29e43c..984f240 100644 Binary files a/data.mv.db and b/data.mv.db differ diff --git a/src/main/java/com/example/demo/news/api/NewsAdminController.java b/src/main/java/com/example/demo/news/api/NewsAdminController.java index f4f65cf..4b12f4b 100644 --- a/src/main/java/com/example/demo/news/api/NewsAdminController.java +++ b/src/main/java/com/example/demo/news/api/NewsAdminController.java @@ -25,6 +25,7 @@ import jakarta.validation.Valid; @RequestMapping(NewsAdminController.URL) public class NewsAdminController { public static final String URL = Constants.ADMIN_PREFIX + "/news"; + private static final String NEWS_URL = NewsController.URL; private static final String NEWS_EDIT_VIEW = "new-edit"; private static final String NEWS_ATTRIBUTE = "news"; private static final String DEPARTMENT_ATTRIBUTE = "departments"; @@ -68,14 +69,14 @@ public class NewsAdminController { return NEWS_EDIT_VIEW; } newsService.create(toEntity(newItem)); - return Constants.REDIRECT_VIEW + URL; + return Constants.REDIRECT_VIEW + NEWS_URL; } @PostMapping("/delete/{id}") public String delete( @PathVariable(name = "id") Long id) { newsService.delete(id); - return Constants.REDIRECT_VIEW + URL; + return Constants.REDIRECT_VIEW + NEWS_URL; } @GetMapping("/edit/{id}") @@ -103,6 +104,6 @@ public class NewsAdminController { throw new IllegalArgumentException(); } newsService.update(id, toEntity(newItem)); - return Constants.REDIRECT_VIEW + URL; + return Constants.REDIRECT_VIEW + NEWS_URL; } } diff --git a/src/main/resources/templates/departments.html b/src/main/resources/templates/departments.html index 0104eb8..d533d73 100644 --- a/src/main/resources/templates/departments.html +++ b/src/main/resources/templates/departments.html @@ -9,15 +9,16 @@