From c0c5439e93df8ccb4e51525263665c56ec55c233 Mon Sep 17 00:00:00 2001 From: Kishore <42832651+kishore03109@users.noreply.github.com> Date: Wed, 6 Dec 2023 09:59:57 +0800 Subject: [PATCH] Untitled commit --- src/services/db/GitHubService.ts | 9 ++++----- src/services/db/RepoService.ts | 4 ++-- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/src/services/db/GitHubService.ts b/src/services/db/GitHubService.ts index 0060eacb7..a0086d2e3 100644 --- a/src/services/db/GitHubService.ts +++ b/src/services/db/GitHubService.ts @@ -235,7 +235,7 @@ export default class GitHubService { async readMedia( sessionData: UserWithSiteSessionData, - { fileSha }: { fileSha: any; branchName?: string } + { fileSha }: { fileSha: string } ) { /** * Files that are bigger than 1 MB needs to be retrieved @@ -268,7 +268,7 @@ export default class GitHubService { async readDirectory( sessionData: UserWithSiteSessionData, - { directoryName }: { directoryName: any } + { directoryName }: { directoryName: string } ) { const { accessToken } = sessionData const { siteName } = sessionData @@ -514,8 +514,7 @@ export default class GitHubService { async getTree( sessionData: UserWithSiteSessionData, githubSessionData: GithubSessionData, - { isRecursive }: any, - isStaging = true + { isRecursive }: any ): Promise { const { accessToken } = sessionData const { siteName } = sessionData @@ -523,7 +522,7 @@ export default class GitHubService { const url = `${siteName}/git/trees/${treeSha}` const params = { - ref: isStaging ? STAGING_BRANCH : STAGING_LITE_BRANCH, + ref: STAGING_BRANCH, recursive: false, } diff --git a/src/services/db/RepoService.ts b/src/services/db/RepoService.ts index 9ffc5d60d..eacd93f07 100644 --- a/src/services/db/RepoService.ts +++ b/src/services/db/RepoService.ts @@ -363,9 +363,9 @@ export default class RepoService extends GitHubService { dirContent = result.value } else { - dirContent = (await super.readDirectory(sessionData, { + dirContent = await super.readDirectory(sessionData, { directoryName, - })) as GitDirectoryItem[] + }) } const { directories, files, total } = getPaginatedDirectoryContents(