@@ -9,17 +9,9 @@ import {
99 type CommitInfo ,
1010 type DiffInfo ,
1111} from " @/lib/git" ;
12-
13- // ... (imports remain)
14-
15- // Fetch comparison data if branches are different
16- let diffData: { commits: CommitInfo []; diffs: DiffInfo [] } = {
17- commits: [],
18- diffs: [],
19- };
2012import { canReadRepo } from " @/lib/permissions" ;
2113import { getRepoPath } from " @/lib/utils" ;
22- import { and , eq , sql , count } from " drizzle-orm" ;
14+ import { and , eq , sql } from " drizzle-orm" ;
2315import {
2416 ArrowLeft ,
2517 ArrowRight ,
@@ -29,9 +21,15 @@ import {
2921 FileText ,
3022 GitCommit ,
3123} from " lucide-react" ;
24+ import type { NodePgDatabase } from " drizzle-orm/node-postgres" ;
3225
3326const { owner : ownerName, repo : repoName } = Astro .params ;
34- const db = getDatabase ();
27+ const db = getDatabase () as NodePgDatabase <typeof schema >;
28+
29+ let diffData: { commits: CommitInfo []; diffs: DiffInfo [] } = {
30+ commits: [],
31+ diffs: [],
32+ };
3533
3634// 1. Fetch Repo & Owner
3735const user = await db .query .users .findFirst ({
@@ -80,7 +78,7 @@ const headBranch =
8078// Fetch comparison data if branches are different
8179// diffData is typed above
8280
83- let error = " " ;
81+ let _error = " " ;
8482let canMerge = false ;
8583
8684if (baseBranch !== headBranch ) {
@@ -89,14 +87,14 @@ if (baseBranch !== headBranch) {
8987 diffData = await compareBranches (repoPath , baseBranch , headBranch );
9088 canMerge = true ; // Simplified: assume mergeable if git commands succeeded
9189 } catch (e ) {
92- error = " Failed to compare branches." ;
90+ _error = " Failed to compare branches." ;
9391 console .error (e );
9492 }
9593}
9694
9795// Fetch open issue count (for header)
9896const issueCountResult = await db
99- .select ({ count: count () })
97+ .select ({ count: sql ` count ` })
10098 .from (schema .issues )
10199 .where (
102100 and (
@@ -129,7 +127,7 @@ const repo = {
129127
130128<BaseLayout title ={ ` New Pull Request · ${repo .owner }/${repo .name } ` } >
131129 <div class =" container py-6" >
132- <RepoHeader repo ={ repo } activeTab =" pulls" />
130+ <RepoHeader repo ={ repo as any } activeTab =" pulls" />
133131
134132 <div class =" mb-6" >
135133 <h1 class =" text-2xl font-semibold mb-4" >Compare changes</h1 >
0 commit comments