()
| 480 | }); |
| 481 | |
| 482 | export 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 | |
| 501 | export const getRepoImage = async (repoId: number): Promise<ArrayBuffer | ServiceError> => sew(async () => { |
| 502 | return await withOptionalAuth(async ({ org, prisma }) => { |
no test coverage detected