From 1a38c30aeef528a56a2a874f61db9023f74451a7 Mon Sep 17 00:00:00 2001 From: arybakov Date: Tue, 20 Aug 2024 15:59:47 -0600 Subject: [PATCH] Fix username for student history --- .../gradstudent/controller/GradStudentController.java | 3 +-- .../api/gradstudent/service/GradStudentService.java | 10 ++++++++-- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/api/src/main/java/ca/bc/gov/educ/api/gradstudent/controller/GradStudentController.java b/api/src/main/java/ca/bc/gov/educ/api/gradstudent/controller/GradStudentController.java index 6bd88e72..a241c1b4 100644 --- a/api/src/main/java/ca/bc/gov/educ/api/gradstudent/controller/GradStudentController.java +++ b/api/src/main/java/ca/bc/gov/educ/api/gradstudent/controller/GradStudentController.java @@ -27,8 +27,7 @@ public class GradStudentController { @SuppressWarnings("unused") private static final Logger logger = LoggerFactory.getLogger(GradStudentController.class); - private static final String BEARER = "Bearer "; - + private final GradStudentService gradStudentService; public GradStudentController(GradStudentService gradStudentService) { diff --git a/api/src/main/java/ca/bc/gov/educ/api/gradstudent/service/GradStudentService.java b/api/src/main/java/ca/bc/gov/educ/api/gradstudent/service/GradStudentService.java index db672025..33eebc16 100644 --- a/api/src/main/java/ca/bc/gov/educ/api/gradstudent/service/GradStudentService.java +++ b/api/src/main/java/ca/bc/gov/educ/api/gradstudent/service/GradStudentService.java @@ -408,14 +408,20 @@ public List getStudentIDsByStatusCode(List studentIDs, String status public List getStudentIDsBySearchCriteriaOrAll(StudentSearchRequest searchRequest) { ArrayList result = new ArrayList<>(); - result.addAll(searchRequest.getStudentIDs()); + boolean paramsNotEmpty = false; + if(searchRequest.getStudentIDs() != null && !searchRequest.getStudentIDs().isEmpty()) { + paramsNotEmpty = true; + result.addAll(searchRequest.getStudentIDs()); + } if(searchRequest.getPens() != null && !searchRequest.getPens().isEmpty()) { + paramsNotEmpty = true; result.addAll(graduationStatusRepository.findStudentIDsByPenIn(searchRequest.getPens())); } if(searchRequest.getSchoolOfRecords() != null && !searchRequest.getSchoolOfRecords().isEmpty()) { + paramsNotEmpty = true; result.addAll(graduationStatusRepository.findBySchoolOfRecordIn(searchRequest.getSchoolOfRecords())); } - if(result.isEmpty()) { + if(!paramsNotEmpty) { result.addAll(graduationStatusRepository.findAllStudentGuids()); } return result;