Skip to content

Commit

Permalink
Merge pull request #3722 from uselagoon/project-org-import-fix-v2
Browse files Browse the repository at this point in the history
refactor: check if project has already been recursed when importing to org
  • Loading branch information
tobybellwood authored May 15, 2024
2 parents be36b8f + 439b455 commit 89e425a
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions services/api/src/resources/organization/resolvers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1065,8 +1065,11 @@ const checkProjectGroups = async (groupProjectIds, projectIds, projectsGroups, m
groupProjectIds.push({group: group.name, project: project})
projectsGroups.push(group)
}
// recurse the project
await checkProjectGroups(groupProjectIds, projectIds, projectsGroups, models, sqlClientPool, project)
// recurse the project if it hasn't already had been done
let index2 = projectIds.findIndex((item) => item === project);
if (index2 === -1) {
await checkProjectGroups(groupProjectIds, projectIds, projectsGroups, models, sqlClientPool, project)
}
}
}
}
Expand Down

0 comments on commit 89e425a

Please sign in to comment.