This commit is contained in:
msukkari 2025-11-13 21:12:56 -08:00
parent 29659031ad
commit 945f0a282f
2 changed files with 5 additions and 17 deletions

View file

@ -1669,22 +1669,6 @@ export const getSearchContexts = async (domain: string) => sew(() =>
}, /* minRequiredRole = */ OrgRole.GUEST), /* allowAnonymousAccess = */ true
));
export const clearSearchContexts = async (domain: string) => sew(() =>
withAuth((userId) =>
withOrgMembership(userId, domain, async ({ org }) => {
await prisma.searchContext.deleteMany({
where: {
orgId: org.id,
},
});
return {
success: true,
};
}, /* minRequiredRole = */ OrgRole.OWNER)
)
)
export const getRepoImage = async (repoId: number): Promise<ArrayBuffer | ServiceError> => sew(async () => {
return await withOptionalAuthV2(async ({ org, prisma }) => {
const repo = await prisma.repo.findUnique({

View file

@ -68,7 +68,11 @@ const initSingleTenancy = async () => {
// the entitlement, synced search contexts, and then no longer had the entitlement
const hasSearchContextEntitlement = hasEntitlement("search-contexts")
if(!hasSearchContextEntitlement) {
clearSearchContexts(SINGLE_TENANT_ORG_DOMAIN)
await prisma.searchContext.deleteMany({
where: {
orgId: SINGLE_TENANT_ORG_ID,
},
});
}
// Sync anonymous access config from the config file