diff --git a/server/src/entities/session.entity.ts b/server/src/entities/session.entity.ts index e4d5431f5497d..e21c6d52ba469 100644 --- a/server/src/entities/session.entity.ts +++ b/server/src/entities/session.entity.ts @@ -30,26 +30,28 @@ export class SessionEntity { deviceOS!: string; } +const userColumns = [ + 'id', + 'email', + 'createdAt', + 'profileImagePath', + 'isAdmin', + 'shouldChangePassword', + 'deletedAt', + 'oauthId', + 'updatedAt', + 'storageLabel', + 'name', + 'quotaSizeInBytes', + 'quotaUsageInBytes', + 'status', + 'profileChangedAt', +] as const; + export const withUser = (eb: ExpressionBuilder) => { return eb .selectFrom('users') - .select([ - 'id', - 'email', - 'createdAt', - 'profileImagePath', - 'isAdmin', - 'shouldChangePassword', - 'deletedAt', - 'oauthId', - 'updatedAt', - 'storageLabel', - 'name', - 'quotaSizeInBytes', - 'quotaUsageInBytes', - 'status', - 'profileChangedAt', - ]) + .select(userColumns) .select((eb) => eb .selectFrom('user_metadata')