mirror of
https://github.com/Dokploy/dokploy.git
synced 2026-06-27 10:05:32 +02:00
fix(web-server-settings): use optional chaining for safer ID access in update function
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
import { db } from "@dokploy/server/db";
|
||||
import { webServerSettings } from "@dokploy/server/db/schema";
|
||||
import { TRPCError } from "@trpc/server";
|
||||
import { eq } from "drizzle-orm";
|
||||
|
||||
/**
|
||||
@@ -38,7 +37,7 @@ export const updateWebServerSettings = async (
|
||||
...updates,
|
||||
updatedAt: new Date(),
|
||||
})
|
||||
.where(eq(webServerSettings.id, current.id))
|
||||
.where(eq(webServerSettings.id, current?.id ?? ""))
|
||||
.returning();
|
||||
|
||||
return updated;
|
||||
|
||||
Reference in New Issue
Block a user