This commit is contained in:
_Bastler 2021-10-07 16:32:37 +02:00
parent 321f55c09d
commit 6d4818943a
2 changed files with 25 additions and 21 deletions

View File

@ -31,6 +31,7 @@ import de.bstly.board.controller.support.EntityResponseStatusException;
import de.bstly.board.controller.support.RequestBodyErrors; import de.bstly.board.controller.support.RequestBodyErrors;
import de.bstly.board.controller.validation.CommentValidator; import de.bstly.board.controller.validation.CommentValidator;
import de.bstly.board.model.Comment; import de.bstly.board.model.Comment;
import de.bstly.board.model.FlaggedStatus;
import de.bstly.board.model.Types; import de.bstly.board.model.Types;
import de.bstly.board.model.Vote; import de.bstly.board.model.Vote;
import de.bstly.board.model.VoteType; import de.bstly.board.model.VoteType;
@ -183,6 +184,7 @@ public class CommentController extends BaseController {
comment.setCreated(Instant.now().plus(getCommentDelay(), ChronoUnit.MINUTES)); comment.setCreated(Instant.now().plus(getCommentDelay(), ChronoUnit.MINUTES));
comment.setAuthor(getCurrentUsername()); comment.setAuthor(getCurrentUsername());
comment.setText(comment.getText().trim()); comment.setText(comment.getText().trim());
comment.setFlaggedStatus(FlaggedStatus.NORMAL);
comment = commentManager.save(comment); comment = commentManager.save(comment);
Vote vote = new Vote(); Vote vote = new Vote();

View File

@ -37,6 +37,7 @@ import de.bstly.board.controller.support.RequestBodyErrors;
import de.bstly.board.controller.validation.EntryValidator; import de.bstly.board.controller.validation.EntryValidator;
import de.bstly.board.model.Entry; import de.bstly.board.model.Entry;
import de.bstly.board.model.EntryStatus; import de.bstly.board.model.EntryStatus;
import de.bstly.board.model.FlaggedStatus;
import de.bstly.board.model.RankedEntry; import de.bstly.board.model.RankedEntry;
import de.bstly.board.model.Types; import de.bstly.board.model.Types;
import de.bstly.board.model.Vote; import de.bstly.board.model.Vote;
@ -296,6 +297,7 @@ public class EntryController extends BaseController {
entry.setCreated(Instant.now()); entry.setCreated(Instant.now());
entry.setAuthor(getCurrentUsername()); entry.setAuthor(getCurrentUsername());
entry.setEntryStatus(EntryStatus.NORMAL); entry.setEntryStatus(EntryStatus.NORMAL);
entry.setFlaggedStatus(FlaggedStatus.NORMAL);
entry.setTitle(entry.getTitle().trim()); entry.setTitle(entry.getTitle().trim());
entry.setText(entry.getText().trim()); entry.setText(entry.getText().trim());
entry = entryManager.save(entry); entry = entryManager.save(entry);