Removed prints.
This commit is contained in:
parent
ae161ba8aa
commit
828304fccb
@ -57,7 +57,6 @@ class Controller {
|
|||||||
|
|
||||||
@PostMapping("/observation")
|
@PostMapping("/observation")
|
||||||
fun addObservation(@Valid @RequestBody newObservation: NewObservation): Long? {
|
fun addObservation(@Valid @RequestBody newObservation: NewObservation): Long? {
|
||||||
println(newObservation)
|
|
||||||
val site = siteRepository.findById(newObservation.site)
|
val site = siteRepository.findById(newObservation.site)
|
||||||
val tutors = tutorRepository.findAllById(newObservation.tutors).toSet()
|
val tutors = tutorRepository.findAllById(newObservation.tutors).toSet()
|
||||||
if(!site.isPresent) return null
|
if(!site.isPresent) return null
|
||||||
@ -85,13 +84,11 @@ class Controller {
|
|||||||
it.observations.add(observation)
|
it.observations.add(observation)
|
||||||
tutorRepository.save(it)
|
tutorRepository.save(it)
|
||||||
}
|
}
|
||||||
println(observation)
|
|
||||||
return observation.id
|
return observation.id
|
||||||
}
|
}
|
||||||
|
|
||||||
@PostMapping("/observations")
|
@PostMapping("/observations")
|
||||||
fun getObservations(@Valid @RequestBody observationsRequest: ObservationsRequest): List<Observation> {
|
fun getObservations(@Valid @RequestBody observationsRequest: ObservationsRequest): List<Observation> {
|
||||||
print(observationsRequest)
|
|
||||||
if (observationsRequest.tutor != null) {
|
if (observationsRequest.tutor != null) {
|
||||||
return tutorRepository.findById(observationsRequest.tutor).map {
|
return tutorRepository.findById(observationsRequest.tutor).map {
|
||||||
when {
|
when {
|
||||||
|
Loading…
Reference in New Issue
Block a user