Skip to content

Commit 3f60dc1

Browse files
committed
Small refactor.
1 parent 21bc52f commit 3f60dc1

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

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

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,8 @@ class DocumentController(
6060
input.json
6161
)
6262

63-
var mapToDocumentView: DocumentView
64-
try {
65-
mapToDocumentView = mapToDocumentView(
63+
return try {
64+
mapToDocumentView(
6665
documentService.updateDocument(
6766
documentId = documentId,
6867
json = input.json,
@@ -72,16 +71,14 @@ class DocumentController(
7271
} catch (e: Exception) {
7372
logger.warn("Failed to update document $documentId. Trying one more time.", e)
7473

75-
mapToDocumentView = mapToDocumentView(
74+
mapToDocumentView(
7675
documentService.updateDocument(
7776
documentId = documentId,
7877
json = input.json,
7978
currentVersion = input.currentVersion,
8079
)
8180
)
8281
}
83-
84-
return mapToDocumentView
8582
}
8683

8784
@Operation(

0 commit comments

Comments
 (0)