[autofix.ci] apply automated fixes

This commit is contained in:
autofix-ci[bot]
2026-04-03 20:30:20 +00:00
committed by GitHub
parent 06b18aca08
commit 4030049ee8
4 changed files with 8 additions and 24 deletions
@@ -193,8 +193,7 @@ export const ShowGitProviders = () => {
await toggleShare({ await toggleShare({
gitProviderId: gitProviderId:
gitProvider.gitProviderId, gitProvider.gitProviderId,
sharedWithOrganization: sharedWithOrganization: checked,
checked,
}) })
.then(() => { .then(() => {
toast.success( toast.success(
@@ -288,17 +287,13 @@ export const ShowGitProviders = () => {
<> <>
{isGithub && haveGithubRequirements && ( {isGithub && haveGithubRequirements && (
<EditGithubProvider <EditGithubProvider
githubId={ githubId={gitProvider.github?.githubId}
gitProvider.github?.githubId
}
/> />
)} )}
{isGitlab && ( {isGitlab && (
<EditGitlabProvider <EditGitlabProvider
gitlabId={ gitlabId={gitProvider.gitlab?.gitlabId}
gitProvider.gitlab?.gitlabId
}
/> />
)} )}
@@ -891,9 +891,7 @@ export const AddUserPermissions = ({ userId, role }: Props) => {
render={() => ( render={() => (
<FormItem className="md:col-span-2"> <FormItem className="md:col-span-2">
<div className="mb-4"> <div className="mb-4">
<FormLabel className="text-base"> <FormLabel className="text-base">Git Providers</FormLabel>
Git Providers
</FormLabel>
<FormDescription> <FormDescription>
Select the Git Providers that the user can access Select the Git Providers that the user can access
</FormDescription> </FormDescription>
@@ -925,8 +923,7 @@ export const AddUserPermissions = ({ userId, role }: Props) => {
} else { } else {
field.onChange( field.onChange(
field.value?.filter( field.value?.filter(
(v) => (v) => v !== provider.gitProviderId,
v !== provider.gitProviderId,
), ),
); );
} }
@@ -71,9 +71,7 @@ export const gitProviderRouter = createTRPCRouter({
allForPermissions: withPermission("member", "update") allForPermissions: withPermission("member", "update")
.use(async ({ ctx, next }) => { .use(async ({ ctx, next }) => {
const licensed = await hasValidLicense( const licensed = await hasValidLicense(ctx.session.activeOrganizationId);
ctx.session.activeOrganizationId,
);
if (!licensed) { if (!licensed) {
throw new TRPCError({ throw new TRPCError({
code: "FORBIDDEN", code: "FORBIDDEN",
@@ -90,10 +88,7 @@ export const gitProviderRouter = createTRPCRouter({
providerType: true, providerType: true,
}, },
orderBy: desc(gitProvider.createdAt), orderBy: desc(gitProvider.createdAt),
where: eq( where: eq(gitProvider.organizationId, ctx.session.activeOrganizationId),
gitProvider.organizationId,
ctx.session.activeOrganizationId,
),
}); });
}), }),
+1 -4
View File
@@ -66,10 +66,7 @@ export const getAccessibleGitProviderIds = async (session: {
columns: { accessedGitProviders: true, role: true }, columns: { accessedGitProviders: true, role: true },
}); });
if ( if (memberRecord?.role === "owner" || memberRecord?.role === "admin") {
memberRecord?.role === "owner" ||
memberRecord?.role === "admin"
) {
return new Set(allOrgProviders.map((p) => p.gitProviderId)); return new Set(allOrgProviders.map((p) => p.gitProviderId));
} }