Skip to content

Commit 945f0a2

Browse files
committed
simplify
1 parent 2965903 commit 945f0a2

File tree

2 files changed

+5
-17
lines changed

2 files changed

+5
-17
lines changed

packages/web/src/actions.ts

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1669,22 +1669,6 @@ export const getSearchContexts = async (domain: string) => sew(() =>
16691669
}, /* minRequiredRole = */ OrgRole.GUEST), /* allowAnonymousAccess = */ true
16701670
));
16711671

1672-
export const clearSearchContexts = async (domain: string) => sew(() =>
1673-
withAuth((userId) =>
1674-
withOrgMembership(userId, domain, async ({ org }) => {
1675-
await prisma.searchContext.deleteMany({
1676-
where: {
1677-
orgId: org.id,
1678-
},
1679-
});
1680-
1681-
return {
1682-
success: true,
1683-
};
1684-
}, /* minRequiredRole = */ OrgRole.OWNER)
1685-
)
1686-
)
1687-
16881672
export const getRepoImage = async (repoId: number): Promise<ArrayBuffer | ServiceError> => sew(async () => {
16891673
return await withOptionalAuthV2(async ({ org, prisma }) => {
16901674
const repo = await prisma.repo.findUnique({

packages/web/src/initialize.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,11 @@ const initSingleTenancy = async () => {
6868
// the entitlement, synced search contexts, and then no longer had the entitlement
6969
const hasSearchContextEntitlement = hasEntitlement("search-contexts")
7070
if(!hasSearchContextEntitlement) {
71-
clearSearchContexts(SINGLE_TENANT_ORG_DOMAIN)
71+
await prisma.searchContext.deleteMany({
72+
where: {
73+
orgId: SINGLE_TENANT_ORG_ID,
74+
},
75+
});
7276
}
7377

7478
// Sync anonymous access config from the config file

0 commit comments

Comments
 (0)