Update clients fetch function

This commit is contained in:
2026-09-27 06:59:16 +01:00
parent c23c8f73cd
commit 8ed5fd1845
24 changed files with 280 additions and 151 deletions
@@ -1,7 +1,5 @@
import type {
BUN_SQLITE_WGUI_CLIENTS,
BUN_SQLITE_WGUI_HOSTS,
} from "@/db/types/db";
import type { BUN_SQLITE_WGUI_HOSTS } from "@/db/types/db";
import grabClients from "@/src/functions/backend/db/clients/grab-clients";
import grabClientRules from "@/src/functions/backend/db/client-rules/grab-client-rules";
import type { PagePropsType, PageQueryObject, TableType } from "@/src/types";
import BunSQLite from "@moduletrace/bun-sqlite";
@@ -19,18 +17,8 @@ const server: BunextPageServerFn<PagePropsType> = async ({
TableType
>({ table: "hosts", targetId: page_query.host_id });
const host_clients = await BunSQLite.select<
BUN_SQLITE_WGUI_CLIENTS,
TableType
>({
table: "clients",
query: {
query: {
host_id: {
value: page_query.host_id,
},
},
},
const host_clients = await grabClients({
host_id: page_query.host_id,
});
const clients = host_clients.payload || null;