diff --git a/src/main/java/com/ffii/tsms/modules/data/web/TeamController.kt b/src/main/java/com/ffii/tsms/modules/data/web/TeamController.kt index 95d9831..66bbcb3 100644 --- a/src/main/java/com/ffii/tsms/modules/data/web/TeamController.kt +++ b/src/main/java/com/ffii/tsms/modules/data/web/TeamController.kt @@ -43,14 +43,9 @@ class TeamController( @GetMapping("/{id}") fun getStaff(@PathVariable id: Long): Map { val staffList = staffsService.findAllByTeamId(id).orElseThrow { NotFoundException() } - val staffIdList: MutableList = mutableListOf() - for (staff in staffList) { - staffIdList.add(staff.id as Long) - } -// val map: Map = java.util.Map.of("team" to teamService.find(id).orElseThrow { NotFoundException() }) -// map["staffIds"] = staffIdList + val staffIdList: List = staffList.map { it.id } return java.util.Map.of( - "team", staffsService.find(id).orElseThrow { NotFoundException() }, + "team", teamService.find(id).orElseThrow { NotFoundException() }, "staffIds", staffIdList ) }