mirror of
https://github.com/Dokploy/dokploy.git
synced 2026-07-06 22:45:24 +02:00
fix(user): scope user.get relation columns to reduce SSR payload size (#4730)
apiKeys and nested user were returned without column projection, shipping secrets (key, permissions, metadata) and unused fields to every page that prefetches user.get, causing the /dashboard/home SSR payload to exceed Next.js's 128kB warning threshold.
This commit is contained in:
@@ -137,8 +137,31 @@ export const userRouter = createTRPCRouter({
|
||||
),
|
||||
with: {
|
||||
user: {
|
||||
columns: {
|
||||
id: true,
|
||||
firstName: true,
|
||||
lastName: true,
|
||||
email: true,
|
||||
image: true,
|
||||
allowImpersonation: true,
|
||||
twoFactorEnabled: true,
|
||||
stripeCustomerId: true,
|
||||
stripeSubscriptionId: true,
|
||||
serversQuantity: true,
|
||||
isEnterpriseCloud: true,
|
||||
sendInvoiceNotifications: true,
|
||||
},
|
||||
with: {
|
||||
apiKeys: true,
|
||||
apiKeys: {
|
||||
columns: {
|
||||
id: true,
|
||||
name: true,
|
||||
prefix: true,
|
||||
enabled: true,
|
||||
expiresAt: true,
|
||||
createdAt: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user