From 7ac5395cfd1cc7a8633370a2ff7499a5fd940a00 Mon Sep 17 00:00:00 2001 From: Akash Shah Date: Thu, 17 Nov 2022 18:58:19 +0530 Subject: [PATCH] Fatal error fix for hotfix code on 5.0.0 --- module/userProjects/helper.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/module/userProjects/helper.js b/module/userProjects/helper.js index 4f7cdf31..e7da3e37 100644 --- a/module/userProjects/helper.js +++ b/module/userProjects/helper.js @@ -3096,14 +3096,14 @@ function _updateUserProfileBasedOnUserRoleInfo(userProfile, userRoleInformation) if(currentProfileUserType.subType && currentProfileUserType.subType !== null) { // If the role has a subType // Check if subType exists in userRoleInformation role, if not means profile data is old and should be reset. - if(!observation.userRoleInformation.role.toUpperCase().includes(currentProfileUserType.subType.toUpperCase())) { + if(!userRoleInformation.role.toUpperCase().includes(currentProfileUserType.subType.toUpperCase())) { resetCurrentUserProfileRoles = true; // Reset userProfile.profileUserTypes break; } } else { // If the role subType is null or is not there // Check if type exists in userRoleInformation role, if not means profile data is old and should be reset. - if(!observation.userRoleInformation.role.toUpperCase().includes(currentProfileUserType.type.toUpperCase())) { + if(!userRoleInformation.role.toUpperCase().includes(currentProfileUserType.type.toUpperCase())) { resetCurrentUserProfileRoles = true; // Reset userProfile.profileUserTypes break; } @@ -3204,7 +3204,7 @@ function _updateUserProfileBasedOnUserRoleInfo(userProfile, userRoleInformation) let userLocations = new Array; userRoleInfomrationLocationKeys.forEach( requestedDataKey => { - if (UTILS.checkIfValidUUID(userRoleInformationLocationObject[requestedDataKey])) { + if (UTILS.checkValidUUID(userRoleInformationLocationObject[requestedDataKey])) { locationIds.push(userRoleInformationLocationObject[requestedDataKey]); } else { locationCodes.push(userRoleInformationLocationObject[requestedDataKey]); @@ -3249,8 +3249,8 @@ function _updateUserProfileBasedOnUserRoleInfo(userProfile, userRoleInformation) } catch (error) { return resolve({ - status: error.status || httpStatusCode.internal_server_error.status, - message: error.message || httpStatusCode.internal_server_error.message, + status: error.status || HTTP_STATUS_CODE['internal_server_error'].status, + message: error.message || HTTP_STATUS_CODE['internal_server_error'].message, data : false }); }