From 60cf6cb29e0522e11e773b257a73c30ed1e75eee Mon Sep 17 00:00:00 2001 From: karthik-tarento Date: Fri, 10 Jun 2022 15:52:26 +0530 Subject: [PATCH] Fix for Government Organisation type in profile page --- src/main/java/org/sunbird/common/util/Constants.java | 2 ++ .../sunbird/user/service/UserUtilityServiceImpl.java | 10 ++++++---- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/main/java/org/sunbird/common/util/Constants.java b/src/main/java/org/sunbird/common/util/Constants.java index d0e4f2f39..223aea083 100644 --- a/src/main/java/org/sunbird/common/util/Constants.java +++ b/src/main/java/org/sunbird/common/util/Constants.java @@ -457,6 +457,8 @@ public class Constants { public static final String VALUES = "values"; public static final String PROGRAM = "Program"; public static final String LIVE = "Live"; + public static final String GOVERNMENT = "Government"; + public static final String ORGANIZATION_TYPE = "organisationType"; private Constants() { throw new IllegalStateException("Utility class"); diff --git a/src/main/java/org/sunbird/user/service/UserUtilityServiceImpl.java b/src/main/java/org/sunbird/user/service/UserUtilityServiceImpl.java index 70d1484f1..99d755e9a 100644 --- a/src/main/java/org/sunbird/user/service/UserUtilityServiceImpl.java +++ b/src/main/java/org/sunbird/user/service/UserUtilityServiceImpl.java @@ -254,13 +254,15 @@ public boolean updateUser(UserRegistration userRegistration) { personalDetails.put(Constants.PRIMARY_EMAIL, userRegistration.getEmail()); profileDetails.put(Constants.PERSONAL_DETAILS, personalDetails); + Map professionDetailObj = new HashMap(); + professionDetailObj.put(Constants.ORGANIZATION_TYPE, Constants.GOVERNMENT); if (StringUtils.isNotEmpty(userRegistration.getPosition())) { - Map professionDetailObj = new HashMap(); professionDetailObj.put(Constants.DESIGNATION, userRegistration.getPosition()); - List> professionalDetailsList = new ArrayList>(); - professionalDetailsList.add(professionDetailObj); - profileDetails.put(Constants.PROFESSIONAL_DETAILS, professionalDetailsList); } + List> professionalDetailsList = new ArrayList>(); + professionalDetailsList.add(professionDetailObj); + profileDetails.put(Constants.PROFESSIONAL_DETAILS, professionalDetailsList); + requestBody.put(Constants.PROFILE_DETAILS, profileDetails); request.put(Constants.REQUEST, requestBody); Map readData = (Map) outboundRequestHandlerService