Skip to content

Commit 2654454

Browse files
feedback
1 parent f04dd33 commit 2654454

1 file changed

Lines changed: 4 additions & 5 deletions

File tree

  • packages/web/src/app/api/(server)/chat/blocking

packages/web/src/app/api/(server)/chat/blocking/route.ts

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff 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[] = [];

0 commit comments

Comments
 (0)