@@ -4,6 +4,7 @@ import io.swagger.v3.oas.annotations.Operation
44import io.swagger.v3.oas.annotations.tags.Tag
55import no.nav.klage.document.api.views.CommentInput
66import no.nav.klage.document.api.views.CommentView
7+ import no.nav.klage.document.api.views.DeleteCommentInput
78import no.nav.klage.document.api.views.ModifyCommentInput
89import no.nav.klage.document.config.SecurityConfiguration.Companion.ISSUER_AAD
910import no.nav.klage.document.domain.Comment
@@ -117,17 +118,32 @@ class CommentsController(
117118 return mapCommentToView(commentService.getComment(commentId = commentId))
118119 }
119120
121+ @Deprecated(" Use POST /{commentId}/delete" )
120122 @Operation(
121123 summary = " Delete a given comment (includes possible thread)" ,
122124 description = " Delete a given comment (includes possible thread)"
123125 )
124126 @DeleteMapping(" /{commentId}" )
125- fun deleteCommentWithPossibleThread (
127+ fun deleteCommentWithPossibleThreadDeprecated (
126128 @PathVariable(" documentId" ) documentId : UUID ,
127129 @PathVariable(" commentId" ) commentId : UUID
130+ ) {
131+ log(" deleteCommentWithPossibleThreadDeprecated called with id $documentId and commentId $commentId " )
132+ commentService.deleteComment(commentId = commentId, loggedInIdent = getIdent()!! , behandlingTildeltIdent = null )
133+ }
134+
135+ @Operation(
136+ summary = " Delete a given comment (includes possible thread)" ,
137+ description = " Delete a given comment (includes possible thread)"
138+ )
139+ @PostMapping(" /{commentId}/delete" )
140+ fun deleteCommentWithPossibleThread (
141+ @PathVariable(" documentId" ) documentId : UUID ,
142+ @PathVariable(" commentId" ) commentId : UUID ,
143+ @RequestBody deleteCommentInput : DeleteCommentInput
128144 ) {
129145 log(" deleteCommentWithPossibleThread called with id $documentId and commentId $commentId " )
130- commentService.deleteComment(commentId = commentId, loggedInIdent = getIdent()!! )
146+ commentService.deleteComment(commentId = commentId, loggedInIdent = getIdent()!! , behandlingTildeltIdent = deleteCommentInput.behandlingTildeltIdent )
131147 }
132148
133149 private fun mapCommentToView (comment : Comment ): CommentView =
0 commit comments