mirror of
https://github.com/andwati/dokploy.git
synced 2026-11-27 22:18:47 +00: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 { 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;
|
||||||
|
|||||||
Reference in New Issue
Block a user