From 98ceba20cc39dfc60418b0de024a4013c408ea74 Mon Sep 17 00:00:00 2001 From: Tony Date: Fri, 3 May 2024 11:45:31 +0800 Subject: [PATCH] fix(route): github pulls (#15452) --- lib/routes/github/pulls.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/routes/github/pulls.ts b/lib/routes/github/pulls.ts index c07b27432..db5b260a7 100644 --- a/lib/routes/github/pulls.ts +++ b/lib/routes/github/pulls.ts @@ -1,5 +1,5 @@ import { Route } from '@/types'; -import got from '@/utils/got'; +import ofetch from '@/utils/ofetch'; import { config } from '@/config'; import MarkdownIt from 'markdown-it'; const md = MarkdownIt({ @@ -28,7 +28,7 @@ export const route: Route = { }, ], name: 'Repo Pull Requests', - maintainers: [], + maintainers: ['hashman', 'TonyRL'], handler, }; @@ -45,8 +45,8 @@ async function handler(ctx) { if (config.github && config.github.access_token) { headers.Authorization = `token ${config.github.access_token}`; } - const response = await got(url, { - searchParams: { + const response = await ofetch(url, { + query: { state, labels, sort: 'created', @@ -55,7 +55,7 @@ async function handler(ctx) { }, headers, }); - const data = response.data.filter((item) => item.pull_request); + const data = response.filter((item) => item.pull_request); return { allowEmpty: true,