mirror of
https://github.com/andwati/dokploy.git
synced 2026-12-03 16:28:46 +00: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: {
|
with: {
|
||||||
user: {
|
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: {
|
with: {
|
||||||
apiKeys: true,
|
apiKeys: {
|
||||||
|
columns: {
|
||||||
|
id: true,
|
||||||
|
name: true,
|
||||||
|
prefix: true,
|
||||||
|
enabled: true,
|
||||||
|
expiresAt: true,
|
||||||
|
createdAt: true,
|
||||||
|
},
|
||||||
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user