Skip to content

Commit

Permalink
Issues #SB-00 fix: issues due to making page api response structure c…
Browse files Browse the repository at this point in the history
…hanges.
  • Loading branch information
John Doe committed May 4, 2018
1 parent aedface commit 0805240
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -262,14 +262,14 @@ private List<String> getAllPublishedCourseListFromEKStep(List<String> ids) {
EkStepRequestUtil.searchContent(
requestData.replace("dataVal", identifier.toString()),
CourseBatchSchedulerUtil.headerMap);
Object[] reslt = (Object[]) result.get(JsonKey.CONTENTS);
for (int i = 0; i < reslt.length; i++) {
Map<String, Object> map = (Map<String, Object>) reslt[i];
String status = (String) map.get(JsonKey.STATUS);
if (ProjectUtil.CourseMgmtStatus.LIVE.getValue().equalsIgnoreCase(status)) {
liveCourseIds.add((String) map.get(JsonKey.IDENTIFIER));
List<Map<String, Object>> reslt = (List<Map<String, Object>>) result.get(JsonKey.CONTENTS);
if (reslt != null)
for (Map<String, Object> map : reslt) {
String status = (String) map.get(JsonKey.STATUS);
if (ProjectUtil.CourseMgmtStatus.LIVE.getValue().equalsIgnoreCase(status)) {
liveCourseIds.add((String) map.get(JsonKey.IDENTIFIER));
}
}
}
ProjectLogger.log("fetching course details from Ekstep completed", LoggerEnum.INFO.name());
return liveCourseIds;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -184,8 +184,8 @@ public static Map<String, Object> getCourseObjectFromEkStep(
String query = EKSTEP_COURSE_SEARCH_QUERY.replaceAll("COURSE_ID_PLACEHOLDER", courseId);
Map<String, Object> result = EkStepRequestUtil.searchContent(query, headers);
if (null != result && !result.isEmpty()) {
Object contentObject = ((Object[]) result.get(JsonKey.CONTENTS))[0];
return (Map<String, Object>) contentObject;
return ((List<Map<String, Object>>) result.get(JsonKey.CONTENTS)).get(0);
// return (Map<String, Object>) contentObject;
}
} catch (Exception e) {
ProjectLogger.log(e.getMessage(), e);
Expand Down

0 comments on commit 0805240

Please sign in to comment.