Skip to content

Commit

Permalink
addressesing sonar cloud
Browse files Browse the repository at this point in the history
  • Loading branch information
soletsdev committed Sep 25, 2024
1 parent 6dbce16 commit fd1266f
Showing 1 changed file with 1 addition and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -401,12 +401,10 @@ public List<SchoolContact> getStudentRegistrationContactList(final String mincod
throw new PenRegAPIRuntimeException("API call to Institute API received null response when getting student registration contacts, contact the Ministry for more info.");
}

List<SchoolContact> activeStudentRegistrationContacts = schoolContactSearchWrapper.getContent().stream().filter(contact -> {
return schoolContactSearchWrapper.getContent().stream().filter(contact -> {
final String expiryDate = contact.getExpiryDate();
return contact.getExpiryDate() == null || (expiryDate != null && LocalDate.parse(expiryDate, DateTimeFormatter.ISO_DATE_TIME).isAfter(LocalDate.now()));
}).toList();

return activeStudentRegistrationContacts;
}catch(Exception e){
log.error("API call to Institute API failure getting student registration contacts :: {}", e.getMessage());
throw new PenRegAPIRuntimeException("API call to Institute API failure getting student registration contacts, contact the Ministry for more info.");
Expand Down

0 comments on commit fd1266f

Please sign in to comment.