Project id for user

This commit is contained in:
2026-02-02 23:55:41 -06:00
parent 9ab1beeef7
commit 5a062ce3a1
4 changed files with 136 additions and 43 deletions

View File

@@ -28,6 +28,7 @@ export interface UserProfile {
name: string;
role: string;
avatarUrl?: string | null;
projectId?: string | null;
createdAt: Date;
}
@@ -230,9 +231,10 @@ export async function getMe(userId: string): Promise<UserProfile> {
name: string;
avatar_url: string | null;
role_name: string;
project_id: string | null;
created_at: Date;
}>(
`SELECT u.id, u.email, u.name, u.avatar_url, r.name as role_name, u.created_at
`SELECT u.id, u.email, u.name, u.avatar_url, r.name as role_name, u.project_id, u.created_at
FROM users u
JOIN roles r ON u.role_id = r.id
WHERE u.id = $1 AND u.is_active = true
@@ -252,6 +254,7 @@ export async function getMe(userId: string): Promise<UserProfile> {
name: user.name,
role: user.role_name,
avatarUrl: user.avatar_url,
projectId: user.project_id,
createdAt: user.created_at,
};
}