Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/cbrelease-4.8.14' into cbrelease…
Browse files Browse the repository at this point in the history
…-4.8.15
  • Loading branch information
karthik-tarento committed Jun 17, 2024
2 parents da0e19f + ae9cb1c commit 5138642
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 7 deletions.
4 changes: 2 additions & 2 deletions src/main/java/org/sunbird/common/util/Constants.java
Original file line number Diff line number Diff line change
Expand Up @@ -438,7 +438,7 @@ public class Constants {
public static final String APPROVED = "approved";
public static final String DENIED = "denied";

public static final String EMAIL_EXIST_ERROR = "Email id already registered";
public static final String EMAIL_EXIST_ERROR = "Email id already registered with another User profile";
public static final String EMAIL_VERIFIED = "emailVerified";
public static final String USER_NAME = "userName";
public static final String USER_FULL_NAME = "fullName";
Expand Down Expand Up @@ -655,7 +655,7 @@ public class Constants {
public static final String CHECKS = "checks";
public static final String CASSANDRA_DB = "cassandra db";
public static final String REDIS_CACHE = "redis cache";
public static final String PHONE_NUMBER_EXIST_ERROR = "Phone number is already registered.";
public static final String PHONE_NUMBER_EXIST_ERROR = "Phone number is already registered with another User profile.";
public static final String MOBILE_NUMBER_EXIST_ERROR = "Mobile number is already registered.";
public static final String PHONE_VERIFIED = "phoneVerified";
public static final String QUERY = "query";
Expand Down
16 changes: 11 additions & 5 deletions src/main/java/org/sunbird/profile/service/ProfileServiceImpl.java
Original file line number Diff line number Diff line change
Expand Up @@ -1758,8 +1758,6 @@ public SBApiResponse profileMDOAdminUpdate(Map<String, Object> request, String u
adminUpdateMap.put(key, profileDetailsMap.get(key));
}
}


Map<String, String> headerValues = new HashMap<>();
headerValues.put(Constants.AUTH_TOKEN, authToken);
headerValues.put(Constants.CONTENT_TYPE, Constants.APPLICATION_JSON);
Expand Down Expand Up @@ -1905,14 +1903,22 @@ public SBApiResponse profileMDOAdminUpdate(Map<String, Object> request, String u
response.getParams().setStatus(Constants.SUCCESS);
} else {
if (updateResponse != null && Constants.CLIENT_ERROR.equalsIgnoreCase((String) updateResponse.get(Constants.RESPONSE_CODE))) {
Map<String, Object> responseParams = (Map<String, Object>) updateResponse.get(Constants.PARAMS);
if(MapUtils.isNotEmpty(responseParams)){
String errorMessage = (String) responseParams.get(Constants.ERROR_MESSAGE);
response.getParams().setErrmsg(errorMessage);
}
response.setResponseCode(HttpStatus.BAD_REQUEST);
} else {
response.setResponseCode(HttpStatus.INTERNAL_SERVER_ERROR);
}
response.getParams().setStatus(Constants.FAILED);
String errMsg = (String) ((Map<String, Object>) updateResponse.get(Constants.PARAMS)).get(Constants.ERROR_MESSAGE);
errMsg = PropertiesCache.getInstance().readCustomError(errMsg);
response.getParams().setErrmsg(errMsg);
String errMsg = response.getParams().getErrmsg();
if(StringUtils.isEmpty(errMsg)){
errMsg = (String) ((Map<String, Object>) updateResponse.get(Constants.PARAMS)).get(Constants.ERROR_MESSAGE);
errMsg = PropertiesCache.getInstance().readCustomError(errMsg);
response.getParams().setErrmsg(errMsg);
}
log.error(errMsg, new Exception(errMsg));
return response;
}
Expand Down

0 comments on commit 5138642

Please sign in to comment.