MCPcopy Index your code
hub / github.com/sourcebot-dev/sourcebot / getSearchContexts

Function getSearchContexts

packages/web/src/actions.ts:482–499  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

480});
481
482export const getSearchContexts = async () => sew(() =>
483 withOptionalAuth(async ({ org, prisma }) => {
484 const searchContexts = await prisma.searchContext.findMany({
485 where: {
486 orgId: org.id,
487 },
488 include: {
489 repos: true,
490 },
491 });
492
493 return searchContexts.map((context) => ({
494 id: context.id,
495 name: context.name,
496 description: context.description ?? undefined,
497 repoNames: context.repos.map((repo) => repo.name),
498 }));
499 }));
500
501export const getRepoImage = async (repoId: number): Promise<ArrayBuffer | ServiceError> => sew(async () => {
502 return await withOptionalAuth(async ({ org, prisma }) => {

Callers 3

useSuggestionsDataFunction · 0.90
ChatLandingPageFunction · 0.90
PageFunction · 0.90

Calls 2

sewFunction · 0.90
withOptionalAuthFunction · 0.90

Tested by

no test coverage detected