From ea820e18bb5e06da9aa1ae07cd94d8bcfbf9740b Mon Sep 17 00:00:00 2001 From: anabellabuckvar <41971124+anabellabuckvar@users.noreply.github.com> Date: Fri, 10 May 2024 12:06:11 -0400 Subject: [PATCH] DOP-4599 fix entitledbranches building --- api/handlers/slack.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/api/handlers/slack.ts b/api/handlers/slack.ts index fc460848a..0451ffa3c 100644 --- a/api/handlers/slack.ts +++ b/api/handlers/slack.ts @@ -20,7 +20,7 @@ export function prepResponse(statusCode, contentType, body) { //if person is admin, get all prod deployable repos export async function buildEntitledGroupsList(entitledRepos: any, repoBranchesRepository: RepoBranchesRepository) { - const entitledBranches: string[] = []; + const entitledBranches: any[] = []; for (const repo of entitledRepos) { const [repoOwner, repoName, directoryPath] = repo.split('/'); const branches = await repoBranchesRepository.getRepoBranches(repoName, directoryPath); @@ -62,10 +62,10 @@ export async function buildEntitledGroupsList(entitledRepos: any, repoBranchesRe .localeCompare(branchOne.text.text.toString().replace(/\d+/g, (n) => +n + 100000)) ), }; - repoOptions.push(repoOption); + entitledBranches.push(repoOption); } } - return repoOptions.sort((repoOne, repoTwo) => repoOne.label.text.localeCompare(repoTwo.label.text)); + return entitledBranches.sort((repoOne, repoTwo) => repoOne.label.text.localeCompare(repoTwo.label.text)); } export function getQSString(qs: string) {