mirror of
https://github.com/fosrl/pangolin.git
synced 2026-02-22 12:56:37 +00:00
small clients ui tweaks
This commit is contained in:
@@ -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";
|
||||
|
||||
@@ -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";
|
||||
|
||||
@@ -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";
|
||||
|
||||
@@ -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")
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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";
|
||||
|
||||
Reference in New Issue
Block a user