diff --git a/main/src/main/java/gsp/technologies/main/api/account/AccountFaceController.java b/main/src/main/java/gsp/technologies/main/api/account/AccountFaceController.java index f6d5edb..7a75c6d 100644 --- a/main/src/main/java/gsp/technologies/main/api/account/AccountFaceController.java +++ b/main/src/main/java/gsp/technologies/main/api/account/AccountFaceController.java @@ -15,6 +15,7 @@ import gsp.technologies.main.api.course.CourseEntity; import gsp.technologies.main.api.organization.OrganizationService; import gsp.technologies.main.api.position.PositionEntity; import gsp.technologies.main.api.position.PositionService; +import gsp.technologies.main.api.target.TargetEntity; import gsp.technologies.main.api.target.TargetService; import gsp.technologies.main.code.Code; @@ -78,6 +79,8 @@ public class AccountFaceController { model.addAttribute("account", account); //передаем в модель перечень доступных курсов + Collection targets = targetService.findAllByPositionId(account.getPosition().getId()); + Collection courses = targetService.findAllByPosition(account.getPosition()); model.addAttribute("courses", courses); //передаем в модель статусы прохождения курсов diff --git a/main/src/main/java/gsp/technologies/main/api/target/TargetService.java b/main/src/main/java/gsp/technologies/main/api/target/TargetService.java index e85d528..04d4e5e 100644 --- a/main/src/main/java/gsp/technologies/main/api/target/TargetService.java +++ b/main/src/main/java/gsp/technologies/main/api/target/TargetService.java @@ -24,7 +24,11 @@ public class TargetService { } public Collection findAllByPosition(PositionEntity position) { - repo.findAllByPosition(position); + return repo.findAllByPosition(position); + } + + public Collection findAllByPositionId(Long id) { + return repo.findAllByPositionId(id); } }