diff --git a/apps/dokploy/server/api/routers/server.ts b/apps/dokploy/server/api/routers/server.ts index 84e383af..6caaa9c8 100644 --- a/apps/dokploy/server/api/routers/server.ts +++ b/apps/dokploy/server/api/routers/server.ts @@ -139,12 +139,16 @@ export const serverRouter = createTRPCRouter({ const currentServer = await findServerById(input.serverId); await removeDeploymentsByServerId(currentServer); await deleteServer(input.serverId); - const admin = await findAdminById(ctx.user.adminId); - await updateServersBasedOnQuantity( - admin.adminId, - admin.serversQuantity, - ); + if (IS_CLOUD) { + const admin = await findAdminById(ctx.user.adminId); + + await updateServersBasedOnQuantity( + admin.adminId, + admin.serversQuantity, + ); + } + return currentServer; } catch (error) { throw error;