Jelajahi Sumber

fix: github stats

Adam 6 bulan lalu
induk
melakukan
79764c8c4c
1 mengubah file dengan 2 tambahan dan 12 penghapusan
  1. 2 12
      packages/console/app/src/lib/github.ts

+ 2 - 12
packages/console/app/src/lib/github.ts

@@ -8,18 +8,8 @@ export const github = query(async () => {
   }
   }
   try {
   try {
     const [meta, releases, contributors] = await Promise.all([
     const [meta, releases, contributors] = await Promise.all([
-      fetch("https://api.github.com/repos/sst/opencode", { headers }).then(async (res) => {
-        const text = await res.text()
-        console.log(text)
-        const json = JSON.parse(text)
-        return json
-      }),
-      fetch("https://api.github.com/repos/sst/opencode/releases", { headers }).then(async (res) => {
-        const text = await res.text()
-        console.log(text)
-        const json = JSON.parse(text)
-        return json
-      }),
+      fetch("https://api.github.com/repos/sst/opencode", { headers }).then((res) => res.json()),
+      fetch("https://api.github.com/repos/sst/opencode/releases", { headers }).then((res) => res.json()),
       fetch("https://api.github.com/repos/sst/opencode/contributors?per_page=1", { headers }),
       fetch("https://api.github.com/repos/sst/opencode/contributors?per_page=1", { headers }),
     ])
     ])
     const [release] = releases
     const [release] = releases