Skip to content

Commit

Permalink
updated code to fetch the batch list from search api (#159)
Browse files Browse the repository at this point in the history
  • Loading branch information
somvitbhowmik authored Dec 2, 2022
1 parent f6eac10 commit 5aaa156
Showing 1 changed file with 8 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -140,10 +140,14 @@ public List<CohortUsers> getActiveUsers(String xAuthUser, String rootOrg, String
// if (!userUtilService.validateUser(rootOrg, userId)) {
// throw new BadRequestException("Invalid UserId.");
// }

List<String> batchIdList = fetchBatchIdDetails(contentId);
if (CollectionUtils.isEmpty(batchIdList)) {
return Collections.emptyList();
List<String> batchIdList = null;
List<SunbirdApiBatchResp> batches = fetchBatchDetails(contentId);
if (!CollectionUtils.isEmpty(batches)) {
batchIdList = batches.stream().map(SunbirdApiBatchResp::getBatchId).collect(Collectors.toList());
//List<String> batchIdList = fetchBatchIdDetails(contentId);
if (CollectionUtils.isEmpty(batchIdList)) {
return Collections.emptyList();
}
}
return fetchParticipantsList(xAuthUser, rootOrg, batchIdList, count);
}
Expand Down

0 comments on commit 5aaa156

Please sign in to comment.