-
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f996a24
commit 442be75
Showing
3 changed files
with
57 additions
and
0 deletions.
There are no files selected for viewing
19 changes: 19 additions & 0 deletions
19
badgers-web/src/app/codeberg/closed-issues/[owner]/[repo]/route.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import { NextRequest } from "next/server" | ||
|
||
import Badge from '@/utils/Badge' | ||
import Codeberg from '@/utils/Codeberg' | ||
|
||
interface Params { | ||
params: { | ||
owner: string | ||
repo: string | ||
} | ||
} | ||
|
||
export async function GET(request: NextRequest, { params: { owner, repo } }: Params) { | ||
const closedIssuesCount = await Codeberg.getClient().getIssuesCount({ owner, repo }, { type: 'issues', state: 'closed' }) | ||
|
||
return await Badge.generate(request, 'closed issues', closedIssuesCount?.toString() ?? 'None') | ||
} | ||
|
||
export const runtime = 'edge' |
19 changes: 19 additions & 0 deletions
19
badgers-web/src/app/codeberg/issues/[owner]/[repo]/route.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import { NextRequest } from "next/server" | ||
|
||
import Badge from '@/utils/Badge' | ||
import Codeberg from '@/utils/Codeberg' | ||
|
||
interface Params { | ||
params: { | ||
owner: string | ||
repo: string | ||
} | ||
} | ||
|
||
export async function GET(request: NextRequest, { params: { owner, repo } }: Params) { | ||
const issuesCount = await Codeberg.getClient().getIssuesCount({ owner, repo }, { type: 'issues', state: 'all' }) | ||
|
||
return await Badge.generate(request, 'issues', issuesCount?.toString() ?? 'None') | ||
} | ||
|
||
export const runtime = 'edge' |
19 changes: 19 additions & 0 deletions
19
badgers-web/src/app/codeberg/open-issues/[owner]/[repo]/route.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import { NextRequest } from "next/server" | ||
|
||
import Badge from '@/utils/Badge' | ||
import Codeberg from '@/utils/Codeberg' | ||
|
||
interface Params { | ||
params: { | ||
owner: string | ||
repo: string | ||
} | ||
} | ||
|
||
export async function GET(request: NextRequest, { params: { owner, repo } }: Params) { | ||
const openIssuesCount = await Codeberg.getClient().getIssuesCount({ owner, repo }, { type: 'issues', state: 'open' }) | ||
|
||
return await Badge.generate(request, 'open issues', openIssuesCount?.toString() ?? 'None') | ||
} | ||
|
||
export const runtime = 'edge' |