fix: update UserProfile role type and enhance API response typings for getProfile and updateProfile
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user