|
|
@@ -43,14 +43,9 @@ class TeamController( |
|
|
|
@GetMapping("/{id}") |
|
|
|
fun getStaff(@PathVariable id: Long): Map<String, Any> { |
|
|
|
val staffList = staffsService.findAllByTeamId(id).orElseThrow { NotFoundException() } |
|
|
|
val staffIdList: MutableList<Long> = mutableListOf() |
|
|
|
for (staff in staffList) { |
|
|
|
staffIdList.add(staff.id as Long) |
|
|
|
} |
|
|
|
// val map: Map<String, Any> = java.util.Map.of("team" to teamService.find(id).orElseThrow { NotFoundException() }) |
|
|
|
// map["staffIds"] = staffIdList |
|
|
|
val staffIdList: List<Long?> = staffList.map { it.id } |
|
|
|
return java.util.Map.of( |
|
|
|
"team", staffsService.find(id).orElseThrow { NotFoundException() }, |
|
|
|
"team", teamService.find(id).orElseThrow { NotFoundException() }, |
|
|
|
"staffIds", staffIdList |
|
|
|
) |
|
|
|
} |
|
|
|