diff --git a/service/src/main/java/org/sunbird/actor/userconsent/UserConsentActor.java b/service/src/main/java/org/sunbird/actor/userconsent/UserConsentActor.java index 2fac5ed9e0aed8788af721ddd3a0e6e18e3ae05f..529895024bdb92c49d754133dd21ee30d3de44ce 100644 --- a/service/src/main/java/org/sunbird/actor/userconsent/UserConsentActor.java +++ b/service/src/main/java/org/sunbird/actor/userconsent/UserConsentActor.java @@ -49,9 +49,13 @@ public class UserConsentActor extends BaseActor { Response response = new Response(); if (CollectionUtils.isNotEmpty(consentList)) { + //Remove revoked consent from the list List<Map<String, Object>> consentResponseList = constructConsentResponse(consentList); - response.put(JsonKey.CONSENT_RESPONSE, consentResponseList); - } else { + consentList=consentResponseList; + } + if(CollectionUtils.isNotEmpty(consentList)){ + response.put(JsonKey.CONSENT_RESPONSE, consentList); + }else { throw new ProjectCommonException( ResponseCode.userConsentNotFound.getErrorCode(), ResponseCode.userConsentNotFound.getErrorMessage(),