diff --git a/src/services/db/GitHubService.ts b/src/services/db/GitHubService.ts index 4973ee212..f4076e281 100644 --- a/src/services/db/GitHubService.ts +++ b/src/services/db/GitHubService.ts @@ -767,7 +767,7 @@ export default class GitHubService { async updateRepoState( sessionData: UserWithSiteSessionData, - { commitSha }: { commitSha: any } + { commitSha }: { commitSha: string } ) { const { accessToken } = sessionData const { siteName } = sessionData diff --git a/src/services/db/RepoService.ts b/src/services/db/RepoService.ts index dc79a5b1f..97f5646c3 100644 --- a/src/services/db/RepoService.ts +++ b/src/services/db/RepoService.ts @@ -20,7 +20,6 @@ import { getMediaFileInfo } from "@root/utils/media-utils" import GitFileCommitService from "./GitFileCommitService" import GitFileSystemService from "./GitFileSystemService" -import GitHubCommitService from "./GithubCommitService" import GitHubService from "./GitHubService" import * as ReviewApi from "./review" @@ -448,29 +447,10 @@ export default class RepoService extends GitHubService { return } - // GitHub flow - const gitTree = await this.getTree(sessionData, githubSessionData, { - isRecursive: true, - }) - - // Retrieve removed items and set their sha to null - const newGitTree = gitTree - .filter( - (item) => - item.path.startsWith(`${directoryName}/`) && item.type !== "tree" - ) - .map((item) => ({ - ...item, - sha: null, - })) - - const newCommitSha = await this.updateTree(sessionData, githubSessionData, { - gitTree: newGitTree, + super.deleteDirectory(sessionData, { + directoryName, message, - }) - - await this.updateRepoState(sessionData, { - commitSha: newCommitSha, + githubSessionData, }) }