(userId: string)
| 80 | * Loads a user's public profile fields, or `null` when no matching user exists. |
| 81 | */ |
| 82 | export async function getUserProfile(userId: string) { |
| 83 | const [userRecord] = await db |
| 84 | .select({ |
| 85 | id: user.id, |
| 86 | name: user.name, |
| 87 | email: user.email, |
| 88 | image: user.image, |
| 89 | emailVerified: user.emailVerified, |
| 90 | }) |
| 91 | .from(user) |
| 92 | .where(eq(user.id, userId)) |
| 93 | .limit(1) |
| 94 | |
| 95 | return userRecord ?? null |
| 96 | } |
no test coverage detected