Skip to content

Commit 2c07aee

Browse files
committed
Better name, and also update date.
1 parent d939259 commit 2c07aee

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

src/main/kotlin/no/nav/klage/document/api/CommentsController.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ class CommentsController(
9696
): CommentView {
9797
log("modifyComment called with id $documentId and commentId $commentId")
9898
return mapCommentToView(
99-
commentService.modifyCommentText(
99+
commentService.setCommentText(
100100
commentId = commentId,
101101
text = modifyCommentInput.text,
102102
loggedInIdent = getIdent()!!

src/main/kotlin/no/nav/klage/document/service/CommentService.kt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,12 +54,13 @@ class CommentService(private val commentRepository: CommentRepository) {
5454
return commentRepository.getReferenceById(commentId)
5555
}
5656

57-
fun modifyCommentText(commentId: UUID, text: String, loggedInIdent: String): Comment {
57+
fun setCommentText(commentId: UUID, text: String, loggedInIdent: String): Comment {
5858
val comment = commentRepository.getReferenceById(commentId)
5959
if (comment.authorIdent != loggedInIdent) {
6060
throw RuntimeException("Not allowed to modify others comment")
6161
}
6262
comment.text = text
63+
comment.modified = LocalDateTime.now()
6364
return comment
6465
}
6566

0 commit comments

Comments
 (0)