summaryrefslogtreecommitdiff
path: root/cgithub/src/index.ts
diff options
context:
space:
mode:
authorJoe Mou <dev@mou.fo>2026-05-27 14:02:36 -0400
committerJoe Mou <dev@mou.fo>2026-05-27 23:38:34 -0400
commit745ac9d83234cb060bf802527efd90d301ecc491 (patch)
tree63ff86be00a976e5a45c8905e06b51b37f53eded /cgithub/src/index.ts
parentc57123139794c3ef174b62c6bd2a54a60bbf3327 (diff)
Pull request index
Diffstat (limited to 'cgithub/src/index.ts')
-rw-r--r--cgithub/src/index.ts9
1 files changed, 9 insertions, 0 deletions
diff --git a/cgithub/src/index.ts b/cgithub/src/index.ts
index db9915f..514f2e2 100644
--- a/cgithub/src/index.ts
+++ b/cgithub/src/index.ts
@@ -9,6 +9,7 @@ import {
getGitHubBlob,
getGitHubCommits,
getGitHubIssues,
+ getGitHubPulls,
getGitHubRelease,
getGitHubReleases,
getGitHubRepo,
@@ -81,6 +82,12 @@ app.get("/:owner/:repo/issues", async (c) => {
return tryRender(c, "issues.eta", getGitHubIssues(owner, repo, { q }));
});
+app.get("/:owner/:repo/pulls", async (c) => {
+ const { owner, repo } = c.req.param();
+ const q = c.req.query("q");
+ return tryRender(c, "pulls.eta", getGitHubPulls(owner, repo, { q }));
+});
+
app.get("/:owner/:repo/search", async (c) => {
const { owner, repo } = c.req.param();
const q = c.req.query("q") ?? "";
@@ -88,6 +95,8 @@ app.get("/:owner/:repo/search", async (c) => {
if (type === "issues") {
return c.redirect(`/${owner}/${repo}/issues?q=${encodeURIComponent(q)}`);
+ } else if (type === "pullrequests") {
+ return c.redirect(`/${owner}/${repo}/pulls?q=${encodeURIComponent(q)}`);
}
// Redirect unhandled search types (like code, which requires sign in anyway).