mirror of
https://github.com/DIYgod/RSSHub.git
synced 2026-09-24 23:12:34 +08:00
fix(route): github pulls (#15452)
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user