Merge pull request #641 from Dokploy/639-cannot-fetch-projects-on-non-main-users-dashboard

refactor(dokploy): add missing project
This commit is contained in:
Mauricio Siu
2024-11-02 01:53:50 -06:00
committed by GitHub

View File

@@ -132,16 +132,20 @@ export const projectRouter = createTRPCRouter({
if (accesedProjects.length === 0) {
return [];
}
const query = await db.query.projects.findMany({
where: sql`${projects.projectId} IN (${sql.join(
accesedProjects.map((projectId) => sql`${projectId}`),
sql`, `,
)})`,
where: and(
sql`${projects.projectId} IN (${sql.join(
accesedProjects.map((projectId) => sql`${projectId}`),
sql`, `,
)})`,
eq(projects.adminId, ctx.user.adminId),
),
with: {
applications: {
where: and(
buildServiceFilter(applications.applicationId, accesedServices),
eq(projects.adminId, ctx.user.adminId),
where: buildServiceFilter(
applications.applicationId,
accesedServices,
),
with: { domains: true },
},