@@ -4,6 +4,7 @@ import io.swagger.v3.oas.annotations.Operation
4
4
import io.swagger.v3.oas.annotations.tags.Tag
5
5
import no.nav.klage.document.api.views.CommentInput
6
6
import no.nav.klage.document.api.views.CommentView
7
+ import no.nav.klage.document.api.views.DeleteCommentInput
7
8
import no.nav.klage.document.api.views.ModifyCommentInput
8
9
import no.nav.klage.document.config.SecurityConfiguration.Companion.ISSUER_AAD
9
10
import no.nav.klage.document.domain.Comment
@@ -117,17 +118,32 @@ class CommentsController(
117
118
return mapCommentToView(commentService.getComment(commentId = commentId))
118
119
}
119
120
121
+ @Deprecated(" Use POST /{commentId}/delete" )
120
122
@Operation(
121
123
summary = " Delete a given comment (includes possible thread)" ,
122
124
description = " Delete a given comment (includes possible thread)"
123
125
)
124
126
@DeleteMapping(" /{commentId}" )
125
- fun deleteCommentWithPossibleThread (
127
+ fun deleteCommentWithPossibleThreadDeprecated (
126
128
@PathVariable(" documentId" ) documentId : UUID ,
127
129
@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(required = false ) deleteCommentInput : DeleteCommentInput ?
128
144
) {
129
145
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 )
131
147
}
132
148
133
149
private fun mapCommentToView (comment : Comment ): CommentView =
0 commit comments