@@ -14,7 +14,6 @@ import org.springframework.web.bind.annotation.*
14
14
import java.util.*
15
15
16
16
@RestController
17
- @CrossOrigin
18
17
@Api(tags = [" kabal-smart-editor-api" ])
19
18
@RequestMapping(" /documents" )
20
19
class DocumentController (
@@ -32,6 +31,7 @@ class DocumentController(
32
31
notes = " Create document"
33
32
)
34
33
@PostMapping(" " )
34
+ @CrossOrigin
35
35
fun createDocument (
36
36
@RequestBody json : String
37
37
): DocumentView {
@@ -44,6 +44,7 @@ class DocumentController(
44
44
notes = " Update document"
45
45
)
46
46
@PutMapping(" /{documentId}" )
47
+ @CrossOrigin
47
48
fun updateDocument (
48
49
@PathVariable(" documentId" ) documentId : UUID ,
49
50
@RequestBody json : String
@@ -57,6 +58,7 @@ class DocumentController(
57
58
notes = " Get document"
58
59
)
59
60
@GetMapping(" /{documentId}" )
61
+ @CrossOrigin
60
62
fun getDocument (@PathVariable(" documentId" ) documentId : UUID ): DocumentView {
61
63
logger.debug(" getDocument" )
62
64
return mapToDocumentView(documentService.getDocument(documentId))
@@ -67,6 +69,7 @@ class DocumentController(
67
69
notes = " Create comment for a given document"
68
70
)
69
71
@PostMapping(" /{documentId}/comments" )
72
+ @CrossOrigin
70
73
fun createComment (
71
74
@PathVariable(" documentId" ) documentId : UUID ,
72
75
@RequestBody commentInput : CommentInput
@@ -87,6 +90,7 @@ class DocumentController(
87
90
notes = " Get all comments for a given document"
88
91
)
89
92
@GetMapping(" /{documentId}/comments" )
93
+ @CrossOrigin
90
94
fun getAllCommentsWithPossibleThreads (
91
95
@PathVariable(" documentId" ) documentId : UUID
92
96
): List <CommentView > {
@@ -99,6 +103,7 @@ class DocumentController(
99
103
notes = " Reply to a given comment"
100
104
)
101
105
@PostMapping(" /{documentId}/comments/{commentId}/replies" )
106
+ @CrossOrigin
102
107
fun replyToComment (
103
108
@PathVariable(" documentId" ) documentId : UUID ,
104
109
@PathVariable(" commentId" ) commentId : UUID ,
@@ -121,6 +126,7 @@ class DocumentController(
121
126
notes = " Get a given comment"
122
127
)
123
128
@GetMapping(" /{documentId}/comments/{commentId}" )
129
+ @CrossOrigin
124
130
fun getCommentWithPossibleThread (
125
131
@PathVariable(" documentId" ) documentId : UUID ,
126
132
@PathVariable(" commentId" ) commentId : UUID
0 commit comments