From b3b009761aade4068a2d819a33aa92bd5196d012 Mon Sep 17 00:00:00 2001 From: ayham291 Date: Mon, 2 Jun 2025 14:45:10 +0200 Subject: [PATCH] fix: made an opsie.. check the organization as well as the user for getAll git providers --- apps/dokploy/server/api/routers/git-provider.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/apps/dokploy/server/api/routers/git-provider.ts b/apps/dokploy/server/api/routers/git-provider.ts index b4daf144..62dd0677 100644 --- a/apps/dokploy/server/api/routers/git-provider.ts +++ b/apps/dokploy/server/api/routers/git-provider.ts @@ -3,7 +3,7 @@ import { db } from "@/server/db"; import { apiRemoveGitProvider, gitProvider } from "@/server/db/schema"; import { findGitProviderById, removeGitProvider } from "@dokploy/server"; import { TRPCError } from "@trpc/server"; -import { desc, eq } from "drizzle-orm"; +import { and, desc, eq } from "drizzle-orm"; export const gitProviderRouter = createTRPCRouter({ getAll: protectedProcedure.query(async ({ ctx }) => { @@ -15,7 +15,10 @@ export const gitProviderRouter = createTRPCRouter({ gitea: true, }, orderBy: desc(gitProvider.createdAt), - where: eq(gitProvider.userId, ctx.session.userId), + where: and( + eq(gitProvider.userId, ctx.session.userId), + eq(gitProvider.organizationId, ctx.session.activeOrganizationId), + ), }); }), remove: protectedProcedure