fix(web-server-settings): use optional chaining for safer ID access in update function

This commit is contained in:
Mauricio Siu
2025-12-24 12:24:27 -06:00
parent 3abc4cdc3b
commit b355d44605
@@ -1,6 +1,5 @@
import { db } from "@dokploy/server/db"; import { db } from "@dokploy/server/db";
import { webServerSettings } from "@dokploy/server/db/schema"; import { webServerSettings } from "@dokploy/server/db/schema";
import { TRPCError } from "@trpc/server";
import { eq } from "drizzle-orm"; import { eq } from "drizzle-orm";
/** /**
@@ -38,7 +37,7 @@ export const updateWebServerSettings = async (
...updates, ...updates,
updatedAt: new Date(), updatedAt: new Date(),
}) })
.where(eq(webServerSettings.id, current.id)) .where(eq(webServerSettings.id, current?.id ?? ""))
.returning(); .returning();
return updated; return updated;