Skip to content

Commit

Permalink
Karma Points Course API Changes to return single record instead List
Browse files Browse the repository at this point in the history
  • Loading branch information
saipradeep_ravipati committed Jan 3, 2024
1 parent b4ab0b8 commit 84f5967
Showing 1 changed file with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,12 @@ public Map<String, Object> fetchKarmaPointsUserCourse(String userId, Map<String,
whereMap.put(Constants.DB_CLOUMN_CONTEXT_TYPE, cntxType);
whereMap.put(Constants.DB_COLUMN_CONTEXT_ID, cntxtId);
whereMap.put(Constants.DB_COLUMN_OPERATION_TYPE, Constants.COURSE_COMPLETION);
Map<String, Object> userKpList = cassandraOperation.getRecordsByProperties(Constants.KEYSPACE_SUNBIRD,
Constants.TABLE_KARMA_POINTS, whereMap, null, Constants.USER_ID_CONSTANT);
resultMap.put(Constants.KARMA_POINTS_LIST, userKpList);
List<Map<String, Object>> userKpList = cassandraOperation.getRecordsByProperties(Constants.KEYSPACE_SUNBIRD,
Constants.TABLE_KARMA_POINTS, whereMap, null);
Map<String, Object> result = new HashMap<>();
if(userKpList !=null && !userKpList.isEmpty())
result = userKpList.get(0);
resultMap.put(Constants.KARMA_POINTS_LIST, result);
return resultMap;
}
public void claimKarmaPoints(ClaimKarmaPointsRequest request) {
Expand Down

0 comments on commit 84f5967

Please sign in to comment.