Skip to content

Commit 5f1a568

Browse files
committed
Fixed bug where wrong input was used. No longer compatible.
1 parent 458400c commit 5f1a568

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

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

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -50,17 +50,14 @@ class DocumentController(
5050
@PutMapping("/{documentId}")
5151
fun updateDocument(
5252
@PathVariable("documentId") documentId: UUID,
53-
@RequestBody(required = false) json: String?,
54-
@RequestBody(required = false) input: DocumentUpdateInput?,
53+
@RequestBody(required = false) input: DocumentUpdateInput,
5554
): DocumentView {
56-
val jsonToUse = input?.json ?: json!!
57-
5855
log("updateDocument called with id $documentId")
59-
secureLogger.debug("updateDocument with id {}: current version: {} received json: {}", documentId, input?.currentVersion, jsonToUse)
56+
secureLogger.debug("updateDocument with id {}: current version: {} received json: {}", documentId, input.currentVersion, input.json)
6057
return mapToDocumentView(documentService.updateDocument(
6158
documentId = documentId,
62-
json = jsonToUse,
63-
currentVersion = input?.currentVersion,
59+
json = input.json,
60+
currentVersion = input.currentVersion,
6461
))
6562
}
6663

0 commit comments

Comments
 (0)