(userId: string)
| 86 | * Get user details by user ID |
| 87 | */ |
| 88 | export async function getUser(userId: string): Promise<User> { |
| 89 | try { |
| 90 | const response = await fetchWithAuth(API_ENDPOINTS.users.detail(userId), { |
| 91 | method: "GET", |
| 92 | }); |
| 93 | |
| 94 | const result: UserDetailResponse = await response.json(); |
| 95 | return result.data; |
| 96 | } catch (error) { |
| 97 | if (error instanceof ApiError) { |
| 98 | throw error; |
| 99 | } |
| 100 | throw new ApiError(500, "Failed to fetch user details"); |
| 101 | } |
| 102 | } |
| 103 | |
| 104 | /** |
| 105 | * Update user information |
nothing calls this directly
no test coverage detected