@@ -131,24 +131,26 @@ fun Routing.documentsRoute(
131131 }
132132 }
133133
134- get(" /api/workspace/{workspaceId}/folder/{id}" ) {
135- val id = call.pathParameters[" id" ]!!
136- val userId = getUserId() ? : " "
137- val workspaceId = call.pathParameters[" workspaceId" ] ? : " "
138-
139- runIfMember(userId, workspaceId, writeopiaDb, debug) {
140- val folder = DocumentsService .getFolderById(id, userId, writeopiaDb)
141-
142- if (folder != null ) {
143- call.respond(
144- status = HttpStatusCode .OK ,
145- message = folder.toApi()
146- )
147- } else {
148- call.respond(
149- status = HttpStatusCode .NotFound ,
150- message = " No lead with id: $id "
151- )
134+ authenticate(" auth-jwt" , optional = debug) {
135+ get(" /api/workspace/{workspaceId}/folder/{id}" ) {
136+ val id = call.pathParameters[" id" ]!!
137+ val userId = getUserId() ? : " "
138+ val workspaceId = call.pathParameters[" workspaceId" ] ? : " "
139+
140+ runIfMember(userId, workspaceId, writeopiaDb, debug) {
141+ val folder = DocumentsService .getFolderById(id, userId, writeopiaDb)
142+
143+ if (folder != null ) {
144+ call.respond(
145+ status = HttpStatusCode .OK ,
146+ message = folder.toApi()
147+ )
148+ } else {
149+ call.respond(
150+ status = HttpStatusCode .NotFound ,
151+ message = " No lead with id: $id "
152+ )
153+ }
152154 }
153155 }
154156 }
0 commit comments