Skip to content

Commit a68343f

Browse files
committed
CORS test
1 parent ae862d3 commit a68343f

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

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

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ import org.springframework.web.bind.annotation.*
1414
import java.util.*
1515

1616
@RestController
17-
@CrossOrigin
1817
@Api(tags = ["kabal-smart-editor-api"])
1918
@RequestMapping("/documents")
2019
class DocumentController(
@@ -32,6 +31,7 @@ class DocumentController(
3231
notes = "Create document"
3332
)
3433
@PostMapping("")
34+
@CrossOrigin
3535
fun createDocument(
3636
@RequestBody json: String
3737
): DocumentView {
@@ -44,6 +44,7 @@ class DocumentController(
4444
notes = "Update document"
4545
)
4646
@PutMapping("/{documentId}")
47+
@CrossOrigin
4748
fun updateDocument(
4849
@PathVariable("documentId") documentId: UUID,
4950
@RequestBody json: String
@@ -57,6 +58,7 @@ class DocumentController(
5758
notes = "Get document"
5859
)
5960
@GetMapping("/{documentId}")
61+
@CrossOrigin
6062
fun getDocument(@PathVariable("documentId") documentId: UUID): DocumentView {
6163
logger.debug("getDocument")
6264
return mapToDocumentView(documentService.getDocument(documentId))
@@ -67,6 +69,7 @@ class DocumentController(
6769
notes = "Create comment for a given document"
6870
)
6971
@PostMapping("/{documentId}/comments")
72+
@CrossOrigin
7073
fun createComment(
7174
@PathVariable("documentId") documentId: UUID,
7275
@RequestBody commentInput: CommentInput
@@ -87,6 +90,7 @@ class DocumentController(
8790
notes = "Get all comments for a given document"
8891
)
8992
@GetMapping("/{documentId}/comments")
93+
@CrossOrigin
9094
fun getAllCommentsWithPossibleThreads(
9195
@PathVariable("documentId") documentId: UUID
9296
): List<CommentView> {
@@ -99,6 +103,7 @@ class DocumentController(
99103
notes = "Reply to a given comment"
100104
)
101105
@PostMapping("/{documentId}/comments/{commentId}/replies")
106+
@CrossOrigin
102107
fun replyToComment(
103108
@PathVariable("documentId") documentId: UUID,
104109
@PathVariable("commentId") commentId: UUID,
@@ -121,6 +126,7 @@ class DocumentController(
121126
notes = "Get a given comment"
122127
)
123128
@GetMapping("/{documentId}/comments/{commentId}")
129+
@CrossOrigin
124130
fun getCommentWithPossibleThread(
125131
@PathVariable("documentId") documentId: UUID,
126132
@PathVariable("commentId") commentId: UUID

0 commit comments

Comments
 (0)