Skip to content

Commit 3e74f9a

Browse files
authored
fix(user): scope user.get relation columns to reduce SSR payload size (Dokploy#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.
1 parent b2692cd commit 3e74f9a

1 file changed

Lines changed: 24 additions & 1 deletion

File tree

  • apps/dokploy/server/api/routers

‎apps/dokploy/server/api/routers/user.ts‎

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,8 +137,31 @@ export const userRouter = createTRPCRouter({
137137
),
138138
with: {
139139
user: {
140+
columns: {
141+
id: true,
142+
firstName: true,
143+
lastName: true,
144+
email: true,
145+
image: true,
146+
allowImpersonation: true,
147+
twoFactorEnabled: true,
148+
stripeCustomerId: true,
149+
stripeSubscriptionId: true,
150+
serversQuantity: true,
151+
isEnterpriseCloud: true,
152+
sendInvoiceNotifications: true,
153+
},
140154
with: {
141-
apiKeys: true,
155+
apiKeys: {
156+
columns: {
157+
id: true,
158+
name: true,
159+
prefix: true,
160+
enabled: true,
161+
expiresAt: true,
162+
createdAt: true,
163+
},
164+
},
142165
},
143166
},
144167
},

0 commit comments

Comments
 (0)