Handle types in handlers

This commit is contained in:
Owen 2025-02-21 12:17:56 -05:00
parent 346f2db5fb
commit bec303821b
No known key found for this signature in database
GPG key ID: 8271FDFFD9E0CCBD
3 changed files with 28 additions and 15 deletions

View file

@ -3,7 +3,7 @@ import { MessageHandler } from "../ws";
import logger from "@server/logger";
import { fromError } from "zod-validation-error";
import db from "@server/db";
import { clients, Site, sites } from "@server/db/schema";
import { clients, Newt, Site, sites } from "@server/db/schema";
import { eq, isNotNull } from "drizzle-orm";
import { findNextAvailableCidr } from "@server/lib/ip";
import config from "@server/lib/config";
@ -17,7 +17,8 @@ const inputSchema = z.object({
type Input = z.infer<typeof inputSchema>;
export const handleGetConfigMessage: MessageHandler = async (context) => {
const { message, newt, sendToClient } = context;
const { message, client, sendToClient } = context;
const newt = client as Newt;
logger.debug("Handling Newt get config message!");