Skip to content

Commit 29b1152

Browse files
committed
Adjust return value from delete.
1 parent d41f1c3 commit 29b1152

File tree

1 file changed

+2
-13
lines changed

1 file changed

+2
-13
lines changed

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

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package no.nav.klage.document.service
22

3+
import no.nav.klage.document.api.views.CommentView
34
import no.nav.klage.document.domain.Comment
45
import no.nav.klage.document.exceptions.MissingAccessException
56
import no.nav.klage.document.repositories.CommentRepository
@@ -75,20 +76,8 @@ class CommentService(private val commentRepository: CommentRepository) {
7576
if (!loggedInIsDocumentOwner && comment.authorIdent != loggedInIdent) {
7677
throw MissingAccessException("Not allowed to delete others comment when not document owner")
7778
}
78-
79-
val commentCopy = Comment(
80-
id = commentId,
81-
parentCommentId = comment.parentCommentId,
82-
documentId = comment.documentId,
83-
text = "",
84-
authorName = comment.authorName,
85-
authorIdent = comment.authorIdent,
86-
comments = comment.comments,
87-
created = comment.created,
88-
modified = LocalDateTime.now(),
89-
)
9079
commentRepository.delete(comment)
9180

92-
return commentCopy
81+
return comment
9382
}
9483
}

0 commit comments

Comments
 (0)