Skip to content

Commit

Permalink
Merge pull request #69 from shikshalokam/master
Browse files Browse the repository at this point in the history
Projects duplicating on programs tile-SB-29227 fix
  • Loading branch information
aks30 authored Mar 16, 2022
2 parents b628f24 + 3193216 commit be7d688
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions module/users/helper.js
Original file line number Diff line number Diff line change
Expand Up @@ -417,7 +417,7 @@ module.exports = class UsersHelper {
},
["name"]
);

if (!programData.length > 0) {
return resolve({
status: httpStatusCode["bad_request"].status,
Expand All @@ -435,7 +435,7 @@ module.exports = class UsersHelper {
constants.common.DEFAULT_PAGE_NO,
search
);

let totalCount = 0;
let mergedData = [];

Expand Down Expand Up @@ -471,24 +471,26 @@ module.exports = class UsersHelper {
token,
programId
);

// Add projectId to the solution object if the user has already started a project for the improvement project solution.
if (importedProjects.success) {

if (importedProjects.data && importedProjects.data.length > 0) {

importedProjects.data.forEach((importedProject) => {


if( projectSolutionIdIndexMap[importedProject.solutionInformation._id] !== undefined ) {

if( projectSolutionIdIndexMap[importedProject.solutionInformation._id] ) {
mergedData[projectSolutionIdIndexMap[importedProject.solutionInformation._id]].projectId = importedProject._id;
} else {

let data = importedProject.solutionInformation;
data['projectTemplateId'] = importedProject.projectTemplateId;
data['projectId'] = importedProject._id;
data["type"] = constants.common.IMPROVEMENT_PROJECT;
mergedData.push(data);
totalCount = totalCount + 1;

}

});
Expand Down

0 comments on commit be7d688

Please sign in to comment.