File tree Expand file tree Collapse file tree
packages/web/src/app/api/(server)/chat/blocking Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -105,8 +105,7 @@ export const POST = apiHandler(async (request: NextRequest) => {
105105 parts : [ { type : 'text' , text : query } ] ,
106106 } ;
107107
108- const selectedSearchScopes : SearchScope [ ] = [ ] ;
109- for ( const repo of repos ) {
108+ const selectedSearchScopes = await Promise . all ( repos . map ( async ( repo ) => {
110109 const repoDB = await prisma . repo . findFirst ( {
111110 where : {
112111 name : repo ,
@@ -121,13 +120,13 @@ export const POST = apiHandler(async (request: NextRequest) => {
121120 } )
122121 }
123122
124- selectedSearchScopes . push ( {
123+ return {
125124 type : 'repo' ,
126125 value : repoDB . name ,
127126 name : repoDB . displayName ?? repoDB . name . split ( '/' ) . pop ( ) ?? repoDB . name ,
128127 codeHostType : repoDB . external_codeHostType ,
129- } )
130- }
128+ } satisfies SearchScope ;
129+ } ) ) ;
131130
132131 // We'll capture the final messages and usage from the stream
133132 let finalMessages : SBChatMessage [ ] = [ ] ;
You can’t perform that action at this time.
0 commit comments