Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
scott-ray-wilson committed Oct 18, 2024
1 parent d63c793 commit de1cd8b
Showing 1 changed file with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,14 @@ export const accessApprovalPolicyServiceFactory = ({
projectDAL,
userDAL
}: TSecretApprovalPolicyServiceFactoryDep) => {
const $getGroupsUsers = async (groupIds: string[], orgId: string) => {
const usersPromises = await Promise.all(
groupIds.map((groupId) => groupDAL.findAllGroupPossibleMembers({ orgId, groupId, offset: 0 }))
);

return usersPromises.map((group) => group.members).flat();
};

const createAccessApprovalPolicy = async ({
name,
actor,
Expand Down Expand Up @@ -110,21 +118,13 @@ export const accessApprovalPolicyServiceFactory = ({
approverUserIds = approverUserIds.concat(approverUsers.map((user) => user.id));
}

const test: number = "test";

const usersPromises: any[] = [];
// await Promise.all(
// groupApprovers.map((groupId) => groupDAL.findAllGroupPossibleMembers({ orgId: actorOrgId, groupId, offset: 0 }))
// )
const verifyAllApprovers = [...approverUserIds];

// for (const groupId of groupApprovers) {
// const userPromise = ;
// usersPromises.push(userPromise);
// }
const verifyGroupApprovers = usersPromises
.map((group) => group.members)
.flat()
const verifyGroupApprovers = (await $getGroupsUsers(groupApprovers, actorOrgId))
.filter((user) => user.isPartOfGroup)
.map((user) => user.id);
verifyAllApprovers.push(...verifyGroupApprovers);
Expand Down

0 comments on commit de1cd8b

Please sign in to comment.