File tree Expand file tree Collapse file tree
src/main/kotlin/fi/hsl/jore4/hastus/api Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -5,7 +5,6 @@ import fi.hsl.jore4.hastus.Constants.MIME_TYPE_CSV
55import fi.hsl.jore4.hastus.api.util.HastusApiErrorType
66import fi.hsl.jore4.hastus.service.exporting.ExportService
77import mu.KotlinLogging
8- import org.springframework.http.HttpStatus
98import org.springframework.http.MediaType
109import org.springframework.http.ResponseEntity
1110import org.springframework.web.bind.annotation.ExceptionHandler
@@ -59,7 +58,7 @@ class ExportController(
5958 LOGGER .info { " Routes request took $elapsed " }
6059
6160 return ResponseEntity
62- .status( HttpStatus . OK )
61+ .ok( )
6362 .body(result)
6463 }
6564
@@ -76,7 +75,7 @@ class ExportController(
7675 LOGGER .error(ex.stackTraceToString())
7776
7877 ResponseEntity
79- .status( HttpStatus . INTERNAL_SERVER_ERROR )
78+ .internalServerError( )
8079 .body(ExportRoutesErrorResponse (HastusApiErrorType .from(ex), ex.message))
8180 }
8281 }
Original file line number Diff line number Diff line change @@ -4,7 +4,6 @@ import fi.hsl.jore4.hastus.Constants.MIME_TYPE_CSV
44import fi.hsl.jore4.hastus.api.util.HastusApiErrorType
55import fi.hsl.jore4.hastus.service.importing.ImportService
66import mu.KotlinLogging
7- import org.springframework.http.HttpStatus
87import org.springframework.http.ResponseEntity
98import org.springframework.web.bind.annotation.ExceptionHandler
109import org.springframework.web.bind.annotation.PostMapping
@@ -74,7 +73,7 @@ class ImportController(
7473 LOGGER .error(ex.stackTraceToString())
7574
7675 ResponseEntity
77- .status( HttpStatus . INTERNAL_SERVER_ERROR )
76+ .internalServerError( )
7877 .body(ImportTimetablesFailureResult (HastusApiErrorType .from(ex), ex.message))
7978 }
8079 }
You can’t perform that action at this time.
0 commit comments