From 6d4818943a4360572a66dea3be02ec2fcc9f0bad Mon Sep 17 00:00:00 2001 From: _Bastler Date: Thu, 7 Oct 2021 16:32:37 +0200 Subject: [PATCH] fix --- .../board/controller/CommentController.java | 2 + .../board/controller/EntryController.java | 44 ++++++++++--------- 2 files changed, 25 insertions(+), 21 deletions(-) diff --git a/src/main/java/de/bstly/board/controller/CommentController.java b/src/main/java/de/bstly/board/controller/CommentController.java index d24739d..0e92d3b 100644 --- a/src/main/java/de/bstly/board/controller/CommentController.java +++ b/src/main/java/de/bstly/board/controller/CommentController.java @@ -31,6 +31,7 @@ import de.bstly.board.controller.support.EntityResponseStatusException; import de.bstly.board.controller.support.RequestBodyErrors; import de.bstly.board.controller.validation.CommentValidator; import de.bstly.board.model.Comment; +import de.bstly.board.model.FlaggedStatus; import de.bstly.board.model.Types; import de.bstly.board.model.Vote; import de.bstly.board.model.VoteType; @@ -183,6 +184,7 @@ public class CommentController extends BaseController { comment.setCreated(Instant.now().plus(getCommentDelay(), ChronoUnit.MINUTES)); comment.setAuthor(getCurrentUsername()); comment.setText(comment.getText().trim()); + comment.setFlaggedStatus(FlaggedStatus.NORMAL); comment = commentManager.save(comment); Vote vote = new Vote(); diff --git a/src/main/java/de/bstly/board/controller/EntryController.java b/src/main/java/de/bstly/board/controller/EntryController.java index e3aefe1..fc31081 100644 --- a/src/main/java/de/bstly/board/controller/EntryController.java +++ b/src/main/java/de/bstly/board/controller/EntryController.java @@ -37,6 +37,7 @@ import de.bstly.board.controller.support.RequestBodyErrors; import de.bstly.board.controller.validation.EntryValidator; import de.bstly.board.model.Entry; import de.bstly.board.model.EntryStatus; +import de.bstly.board.model.FlaggedStatus; import de.bstly.board.model.RankedEntry; import de.bstly.board.model.Types; import de.bstly.board.model.Vote; @@ -63,11 +64,11 @@ public class EntryController extends BaseController { /** * Fetch by ranking. * - * @param pageParameter the page parameter - * @param sizeParameter the size parameter - * @param dateParameter the date parameter + * @param pageParameter the page parameter + * @param sizeParameter the size parameter + * @param dateParameter the date parameter * @param gravityParameter the gravity parameter - * @param ignoreParameter the ignore parameter + * @param ignoreParameter the ignore parameter * @return the page */ @PreAuthorize("isAuthenticated()") @@ -110,9 +111,9 @@ public class EntryController extends BaseController { /** * Fetch by date. * - * @param pageParameter the page parameter - * @param sizeParameter the size parameter - * @param dateParameter the date parameter + * @param pageParameter the page parameter + * @param sizeParameter the size parameter + * @param dateParameter the date parameter * @param ignoreParameter the ignore parameter * @return the page */ @@ -142,11 +143,11 @@ public class EntryController extends BaseController { /** * Fetch by comments. * - * @param pageParameter the page parameter - * @param sizeParameter the size parameter - * @param dateParameter the date parameter + * @param pageParameter the page parameter + * @param sizeParameter the size parameter + * @param dateParameter the date parameter * @param gravityParameter the gravity parameter - * @param ignoreParameter the ignore parameter + * @param ignoreParameter the ignore parameter * @return the page */ @PreAuthorize("isAuthenticated()") @@ -183,9 +184,9 @@ public class EntryController extends BaseController { /** * Fetch by last. * - * @param pageParameter the page parameter - * @param sizeParameter the size parameter - * @param dateParameter the date parameter + * @param pageParameter the page parameter + * @param sizeParameter the size parameter + * @param dateParameter the date parameter * @param ignoreParameter the ignore parameter * @return the page */ @@ -216,11 +217,11 @@ public class EntryController extends BaseController { /** * Fetch by user. * - * @param username the username - * @param pageParameter the page parameter - * @param sizeParameter the size parameter - * @param dateParameter the date parameter - * @param ascParameter the asc parameter + * @param username the username + * @param pageParameter the page parameter + * @param sizeParameter the size parameter + * @param dateParameter the date parameter + * @param ascParameter the asc parameter * @param ignoreParameter the ignore parameter * @return the page */ @@ -253,7 +254,7 @@ public class EntryController extends BaseController { /** * Gets the entry. * - * @param id the id + * @param id the id * @param ignoreParameter the ignore parameter * @return the entry */ @@ -277,7 +278,7 @@ public class EntryController extends BaseController { /** * Creates the entry. * - * @param entry the entry + * @param entry the entry * @param ignoreParameter the ignore parameter * @return the entry */ @@ -296,6 +297,7 @@ public class EntryController extends BaseController { entry.setCreated(Instant.now()); entry.setAuthor(getCurrentUsername()); entry.setEntryStatus(EntryStatus.NORMAL); + entry.setFlaggedStatus(FlaggedStatus.NORMAL); entry.setTitle(entry.getTitle().trim()); entry.setText(entry.getText().trim()); entry = entryManager.save(entry);