Skip to content

Commit

Permalink
refactor: check if project has already been recursed when importing t…
Browse files Browse the repository at this point in the history
…o org
  • Loading branch information
shreddedbacon committed May 14, 2024
1 parent 5a65daf commit 439b455
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 439b455

Please sign in to comment.