We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3fa5585 commit c63dfbeCopy full SHA for c63dfbe
src/app/api/check-repo/route.ts
@@ -11,11 +11,13 @@ export async function GET(req: NextRequest) {
11
const repoId = req.nextUrl.searchParams.get('repoId');
12
if (typeof repoId !== 'string') return new Response(null, { status: 400 });
13
14
- const repo = await db
+ const [repo] = await db
15
.select()
16
.from(reportsTable)
17
.where(eq(reportsTable.repoId, parseInt(repoId)))
18
.limit(1);
19
20
+ if (!repo) return Response.json(null);
21
+
22
return Response.json(repo);
23
}
0 commit comments