Skip to content

Commit

Permalink
Code fix.
Browse files Browse the repository at this point in the history
  • Loading branch information
aks30 committed Nov 15, 2022
1 parent 734b80d commit 3c730b4
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion module/userProjects/helper.js
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,9 @@ module.exports = class UserProjectsHelper {

const projectsModel = Object.keys(schemas["projects"].schema);

if(data.userRoleInformation) delete data.userRoleInformation;
if(data.userProfile) delete data.userProfile;

let updateProject = {};
let projectData = await _projectData(data);
if (projectData && projectData.success == true) {
Expand Down Expand Up @@ -1269,7 +1272,7 @@ module.exports = class UserProjectsHelper {
projectCreation.data.userRoleInformation = userRoleInformation;

//compare & update userProfile with userRoleInformation
if ( projectCreation.data.userProfile && userRoleInformation ) {
if ( projectCreation.data.userProfile && userRoleInformation && Object.keys(userRoleInformation).length > 0 && Object.keys(projectCreation.data.userProfile).length > 0 ) {
let updatedUserProfile = await _updateUserProfileBasedOnUserRoleInfo(
projectCreation.data.userProfile,
userRoleInformation
Expand Down

0 comments on commit 3c730b4

Please sign in to comment.