Skip to content

Commit

Permalink
Added the live check for courses when populating data (#414)
Browse files Browse the repository at this point in the history
* Added the live check for courses when populating data

* Code review changes
  • Loading branch information
Sahil-tarento authored Jan 9, 2024
1 parent 1b22cc7 commit c8702b1
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/main/java/org/sunbird/cbp/service/CbPlanServiceImpl.java
Original file line number Diff line number Diff line change
Expand Up @@ -498,7 +498,9 @@ public SBApiResponse getCBPlanListForUser(String userOrgId, String authTokenOrUs
} else {
contentDetails = (Map<String, Object>) courseDetailsMap.get(courseId);
}
courseList.add(contentDetails);
if (MapUtils.isNotEmpty(contentDetails)) {
courseList.add(contentDetails);
}
}
cbPlanDetails.put(Constants.CB_CONTENT_LIST, courseList);
resultMap.add(cbPlanDetails);
Expand Down Expand Up @@ -656,9 +658,7 @@ private Map<String, Object> populateReadData(Map<String, Object> cbPlan) throws
}
}
}
if (CollectionUtils.isNotEmpty(enrichContentInfoMap)) {
enrichData.put(Constants.CONTENT_LIST, enrichContentInfoMap);
}
enrichData.put(Constants.CONTENT_LIST, enrichContentInfoMap);
return enrichData;
}

Expand Down Expand Up @@ -903,7 +903,9 @@ public SBApiResponse listCbPlan(SunbirdApiRequest request, String userOrgId, Str
}
}
}
courseMapList.add(courseInfoMap.get(contentId));
if (courseInfoMap.containsKey(contentId)) {
courseMapList.add(courseInfoMap.get(contentId));
}
}
cbPlan.put(Constants.CB_CONTENT_LIST, courseMapList);

Expand Down

0 comments on commit c8702b1

Please sign in to comment.