mirror of
https://github.com/EnixCoda/Gitako.git
synced 2026-03-11 08:54:44 +00:00
fix: types in GitHubHelper
This commit is contained in:
parent
7b929a0d77
commit
706b0c530c
1 changed files with 9 additions and 3 deletions
|
|
@ -74,15 +74,21 @@ async function getTreeData({ userName, repoName, branchName, accessToken }: Meta
|
|||
export type ItemData = {
|
||||
userName: string
|
||||
repoName: string
|
||||
branchName: string
|
||||
accessToken: string
|
||||
}
|
||||
|
||||
export type BlobData = {
|
||||
encoding: 'base64' | string
|
||||
fileSHA: string
|
||||
} & ItemData
|
||||
content?: string
|
||||
}
|
||||
|
||||
async function getBlobData({ userName, repoName, accessToken, fileSHA }: BlobData) {
|
||||
async function getBlobData({
|
||||
userName,
|
||||
repoName,
|
||||
accessToken,
|
||||
fileSHA,
|
||||
}: Pick<ItemData & BlobData, 'userName' | 'repoName' | 'accessToken' | 'fileSHA'>) {
|
||||
const url = `https://api.github.com/repos/${userName}/${repoName}/git/blobs/${fileSHA}`
|
||||
return await request(url, { accessToken })
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue