Skip to content

Commit d939259

Browse files
committed
Fix duplicate path
1 parent 8eab291 commit d939259

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

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

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import io.swagger.v3.oas.annotations.Operation
44
import io.swagger.v3.oas.annotations.tags.Tag
55
import no.nav.klage.document.api.views.CommentInput
66
import no.nav.klage.document.api.views.CommentView
7+
import no.nav.klage.document.api.views.ModifyCommentInput
78
import no.nav.klage.document.config.SecurityConfiguration.Companion.ISSUER_AAD
89
import no.nav.klage.document.domain.Comment
910
import no.nav.klage.document.service.CommentService
@@ -87,17 +88,17 @@ class CommentsController(
8788
summary = "Modify a given comment",
8889
description = "Modify a given comment"
8990
)
90-
@PostMapping("/{commentId}/replies")
91+
@PatchMapping("/{commentId}")
9192
fun modifyComment(
9293
@PathVariable("documentId") documentId: UUID,
9394
@PathVariable("commentId") commentId: UUID,
94-
@RequestBody commentInput: CommentInput,
95+
@RequestBody modifyCommentInput: ModifyCommentInput,
9596
): CommentView {
9697
log("modifyComment called with id $documentId and commentId $commentId")
9798
return mapCommentToView(
9899
commentService.modifyCommentText(
99100
commentId = commentId,
100-
text = commentInput.text,
101+
text = modifyCommentInput.text,
101102
loggedInIdent = getIdent()!!
102103
)
103104
)

src/main/kotlin/no/nav/klage/document/api/views/CommentInput.kt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,7 @@ data class CommentInput(
99
val ident: String
1010
)
1111
}
12+
13+
data class ModifyCommentInput(
14+
val text: String,
15+
)

0 commit comments

Comments
 (0)