small clients ui tweaks

This commit is contained in:
miloschwartz
2025-04-20 16:49:48 -04:00
parent f960fb7d67
commit fa6fc9e80d
25 changed files with 215 additions and 377 deletions

View File

@@ -12,7 +12,7 @@ import {
exitNodes,
orgs,
sites
} from "@server/db/schema";
} from "@server/db/schemas";
import response from "@server/lib/response";
import HttpCode from "@server/types/HttpCode";
import createHttpError from "http-errors";

View File

@@ -1,7 +1,7 @@
import { Request, Response, NextFunction } from "express";
import { z } from "zod";
import { db } from "@server/db";
import { clients, clientSites } from "@server/db/schema";
import { clients, clientSites } from "@server/db/schemas";
import { eq } from "drizzle-orm";
import response from "@server/lib/response";
import HttpCode from "@server/types/HttpCode";

View File

@@ -1,7 +1,7 @@
import { Request, Response, NextFunction } from "express";
import { z } from "zod";
import { db } from "@server/db";
import { clients } from "@server/db/schema";
import { clients } from "@server/db/schemas";
import { eq, and } from "drizzle-orm";
import response from "@server/lib/response";
import HttpCode from "@server/types/HttpCode";

View File

@@ -6,7 +6,7 @@ import {
sites,
userClients,
clientSites
} from "@server/db/schema";
} from "@server/db/schemas";
import logger from "@server/logger";
import HttpCode from "@server/types/HttpCode";
import response from "@server/lib/response";
@@ -53,6 +53,7 @@ function queryClients(orgId: string, accessibleClientIds: number[]) {
})
.from(clients)
.leftJoin(orgs, eq(clients.orgId, orgs.orgId))
.leftJoin(orgs, eq(clients.orgId, orgs.orgId))
.where(
and(
inArray(clients.clientId, accessibleClientIds),
@@ -63,7 +64,7 @@ function queryClients(orgId: string, accessibleClientIds: number[]) {
async function getSiteAssociations(clientIds: number[]) {
if (clientIds.length === 0) return [];
return db
.select({
clientId: clientSites.clientId,
@@ -205,4 +206,4 @@ export async function listClients(
createHttpError(HttpCode.INTERNAL_SERVER_ERROR, "An error occurred")
);
}
}
}

View File

@@ -4,7 +4,7 @@ import { db } from "@server/db";
import {
clients,
clientSites
} from "@server/db/schema";
} from "@server/db/schemas";
import response from "@server/lib/response";
import HttpCode from "@server/types/HttpCode";
import createHttpError from "http-errors";