we dont depend on repo api anymore other than for contents

このコミットが含まれているのは:
Arya Kiran 2023-02-15 17:31:43 +05:30
コミット 722dd813f1
この署名に対応する既知のキーがデータベースに存在しません
GPGキーID: 842D12BDA50DF120
1個のファイルの変更13行の追加12行の削除

ファイルの表示

@ -49,18 +49,6 @@ func HandleRepo(c *fiber.Ctx) error {
})
}
// API
repo := utils.GetRequest("https://api.github.com/repos/" + c.Params("user") + "/" + c.Params("repo"))
repoFiles := utils.GetRequest("https://api.github.com/repos/" + c.Params("user") + "/" + c.Params("repo") + "/contents")
bruh := repoFiles.Get("#.@pretty").Array()
for _, item := range bruh {
repoFilesArray = append(repoFilesArray, RepoFiles{
Name: item.Get("path").String(),
Path: item.Get("path").String(),
Type: item.Get("type").String(),
Fullname: repo.Get("full_name").String(),
DefaultBranch: repo.Get("default_branch").String(),
})
}
// Scraping
Scrape := Repo{}
@ -98,6 +86,19 @@ func HandleRepo(c *fiber.Ctx) error {
// Add scrape-based info to repoArray
repoArray = append(repoArray, Scrape)
// API
repoFiles := utils.GetRequest("https://api.github.com/repos/" + c.Params("user") + "/" + c.Params("repo") + "/contents")
bruh := repoFiles.Get("#.@pretty").Array()
for _, item := range bruh {
repoFilesArray = append(repoFilesArray, RepoFiles{
Name: item.Get("path").String(),
Path: item.Get("path").String(),
Type: item.Get("type").String(),
Fullname: Scrape.Fullname,
DefaultBranch: Scrape.DefaultBranch,
})
}
// README
var readmee string
err := requests.