Skip to content

Commit

Permalink
Handling empty content for explore list
Browse files Browse the repository at this point in the history
  • Loading branch information
karthik-tarento committed Feb 27, 2024
1 parent 099216d commit 72f03f6
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -128,12 +128,16 @@ public SBApiResponse getExploreCourseListV2() {
for (Map<String, Object> course : courseList) {
identifierList.add((String) course.get(Constants.IDENTIFIER));
}
Map<String, Object> searchResponse = searchContent(identifierList);
if (!Constants.OK.equalsIgnoreCase((String) searchResponse.get(Constants.RESPONSE_CODE))) {
errMsg = "Failed to get contant details for Identifier List from DB.";
if(identifierList.isEmpty()) {
errMsg = "Contents are not configured in Database.";
} else {
Map<String, Object> responseCourseList = (Map<String, Object>) searchResponse.get(Constants.RESULT);
response.setResult(responseCourseList);
Map<String, Object> searchResponse = searchContent(identifierList);
if (!Constants.OK.equalsIgnoreCase((String) searchResponse.get(Constants.RESPONSE_CODE))) {
errMsg = "Failed to get contant details for Identifier List from DB.";
} else {
Map<String, Object> responseCourseList = (Map<String, Object>) searchResponse.get(Constants.RESULT);
response.setResult(responseCourseList);
}
}
} catch (Exception e) {
errMsg = "Failed to retrieve explore course list. Exception: " + e.getMessage();
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/application.properties
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ org.create.endpoint=v1/org/create
km.base.host=http://knowledge-mw-service:5000/
km.base.framework.path=action/framework/v3/read/
km.base.composite.search.path=v1/search
km.base.composite.search.fields=appIcon,channel,contentType,description,duration,idealScreenSize,identifier,instructions,license,mimeType,name,objectType,organisation,pkgVersion,posterImage,primaryCategory,purpose,version
km.base.composite.search.fields=appIcon,channel,contentType,description,duration,idealScreenSize,identifier,instructions,license,mimeType,name,objectType,organisation,pkgVersion,posterImage,primaryCategory,purpose,version,resourceCategory,cloudStorageKey
km.base.composite.search.filters.primaryCategory=Course
km.base.content.search=v1/content/search

Expand Down

0 comments on commit 72f03f6

Please sign in to comment.