fix: update UserProfile role type and enhance API response typings for getProfile and updateProfile

This commit is contained in:
GitHub Actions
2026-03-04 12:43:41 +00:00
parent f19f53ed9a
commit 4e9e1919a8

View File

@@ -220,7 +220,7 @@ export interface UserProfile {
id: number
email: string
name: string
role: string
role: 'admin' | 'user' | 'passthrough'
has_api_key: boolean
api_key_masked: string
}
@@ -238,7 +238,7 @@ export interface RegenerateApiKeyResponse {
* @returns Promise resolving to UserProfile
*/
export const getProfile = async (): Promise<UserProfile> => {
const response = await client.get('/user/profile')
const response = await client.get<UserProfile>('/user/profile')
return response.data
}
@@ -248,7 +248,7 @@ export const getProfile = async (): Promise<UserProfile> => {
* @returns Promise resolving to success message
*/
export const updateProfile = async (data: { name: string; email: string; current_password?: string }): Promise<{ message: string }> => {
const response = await client.post('/user/profile', data)
const response = await client.post<{ message: string }>('/user/profile', data)
return response.data
}