File tree Expand file tree Collapse file tree 1 file changed +2
-13
lines changed
src/main/kotlin/no/nav/klage/document/service Expand file tree Collapse file tree 1 file changed +2
-13
lines changed Original file line number Diff line number Diff line change 1
1
package no.nav.klage.document.service
2
2
3
+ import no.nav.klage.document.api.views.CommentView
3
4
import no.nav.klage.document.domain.Comment
4
5
import no.nav.klage.document.exceptions.MissingAccessException
5
6
import no.nav.klage.document.repositories.CommentRepository
@@ -75,20 +76,8 @@ class CommentService(private val commentRepository: CommentRepository) {
75
76
if (! loggedInIsDocumentOwner && comment.authorIdent != loggedInIdent) {
76
77
throw MissingAccessException (" Not allowed to delete others comment when not document owner" )
77
78
}
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
- )
90
79
commentRepository.delete(comment)
91
80
92
- return commentCopy
81
+ return comment
93
82
}
94
83
}
You can’t perform that action at this time.
0 commit comments