diff --git a/src/main/java/com/techlooper/service/impl/ChallengeServiceImpl.java b/src/main/java/com/techlooper/service/impl/ChallengeServiceImpl.java index b898a1b6b..05431c135 100644 --- a/src/main/java/com/techlooper/service/impl/ChallengeServiceImpl.java +++ b/src/main/java/com/techlooper/service/impl/ChallengeServiceImpl.java @@ -300,15 +300,14 @@ public List listChallenges() { // } // return sortChallengesByDescendingStartDate(challenges); TermQueryBuilder notExpiredQuery = termQuery("expired", Boolean.TRUE); - Iterable challenges = challengeRepository.search(boolQuery().mustNot(notExpiredQuery)); - ArrayList dtos = new ArrayList<>(); - challenges.forEach(challengeEntity -> { + Iterable challengeIterator = challengeRepository.search(boolQuery().mustNot(notExpiredQuery)); + ArrayList challenges = new ArrayList<>(); + challengeIterator.forEach(challengeEntity -> { ChallengeDetailDto challengeDetailDto = dozerMapper.map(challengeEntity, ChallengeDetailDto.class); challengeDetailDto.setNumberOfRegistrants(getNumberOfRegistrants(challengeEntity.getChallengeId())); - dtos.add(challengeDetailDto); + challenges.add(challengeDetailDto); }); - dozerMapper.map(challenges, dtos); - return dtos; + return sortChallengesByDescendingStartDate(challenges); } private void sendContestApplicationEmail(Template template, String mailSubject, Address[] recipientAddresses, diff --git a/src/main/resources/local/techlooper.properties b/src/main/resources/local/techlooper.properties index 9b3440db8..36dfe03b1 100644 --- a/src/main/resources/local/techlooper.properties +++ b/src/main/resources/local/techlooper.properties @@ -91,8 +91,9 @@ mail.notifyChallengeTimelineRegistration.subject.en = %d more day(s) to start %s mail.notifyChallengeTimelineInProgress.subject.vn = C\u00F2n %d ng\u00E0y n\u1EEFa t\u1EDBi h\u1EA1n g\u1EEDi s\u1EA3n ph\u1EA9m cho th\u1EED th\u00E1ch %s mail.notifyChallengeTimelineInProgress.subject.en = %d more day(s) to submit for %s -mail.onBoarding.subject.en = Are you ready to become a Tech Talent?
 mail.onBoarding.subject.vi = B\u1EA1n \u0111\u00E3 s\u1EB5n s\u00E0ng tr\u1EDF th\u00E0nh m\u1ED9t Nh\u00E2n T\u00E0i C\u00F4ng Ngh\u1EC7? +mail.onBoarding.subject.en = Are you ready to become a Tech Talent + diff --git a/src/main/resources/production/techlooper.properties b/src/main/resources/production/techlooper.properties index 45ccea18a..3c17acac1 100644 --- a/src/main/resources/production/techlooper.properties +++ b/src/main/resources/production/techlooper.properties @@ -91,5 +91,5 @@ mail.notifyChallengeTimelineRegistration.subject.en = %d more day(s) to start %s mail.notifyChallengeTimelineInProgress.subject.vn = C\u00F2n %d ng\u00E0y n\u1EEFa t\u1EDBi h\u1EA1n g\u1EEDi s\u1EA3n ph\u1EA9m cho th\u1EED th\u00E1ch %s mail.notifyChallengeTimelineInProgress.subject.en = %d more day(s) to submit for %s -mail.onBoarding.subject.en = Are you ready to become a Tech Talent?
 +mail.onBoarding.subject.en = Are you ready to become a Tech Talent mail.onBoarding.subject.vi = B\u1EA1n \u0111\u00E3 s\u1EB5n s\u00E0ng tr\u1EDF th\u00E0nh m\u1ED9t Nh\u00E2n T\u00E0i C\u00F4ng Ngh\u1EC7? diff --git a/src/main/resources/staging/techlooper.properties b/src/main/resources/staging/techlooper.properties index cf16d531e..a45e11614 100644 --- a/src/main/resources/staging/techlooper.properties +++ b/src/main/resources/staging/techlooper.properties @@ -92,5 +92,5 @@ mail.notifyChallengeTimelineRegistration.subject.en = %d more day(s) to start %s mail.notifyChallengeTimelineInProgress.subject.vn = C\u00F2n %d ng\u00E0y n\u1EEFa t\u1EDBi h\u1EA1n g\u1EEDi s\u1EA3n ph\u1EA9m cho th\u1EED th\u00E1ch %s mail.notifyChallengeTimelineInProgress.subject.en = %d more day(s) to submit for %s -mail.onBoarding.subject.en = Are you ready to become a Tech Talent?
 +mail.onBoarding.subject.en = Are you ready to become a Tech Talent mail.onBoarding.subject.vi = B\u1EA1n \u0111\u00E3 s\u1EB5n s\u00E0ng tr\u1EDF th\u00E0nh m\u1ED9t Nh\u00E2n T\u00E0i C\u00F4ng Ngh\u1EC7? \ No newline at end of file