fix(route): github pulls (#15452)

This commit is contained in:
Tony
2024-05-03 03:45:31 +00:00
committed by GitHub
parent b1ca4375bd
commit 98ceba20cc
+5 -5
View File
@@ -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,