Fix avatars upload
This commit is contained in:
@@ -39,4 +39,12 @@ export const usersApi = {
|
||||
const response = await client.post<{ message: string }>('/users/me/password', data)
|
||||
return response.data
|
||||
},
|
||||
|
||||
// Получить аватар пользователя как blob URL
|
||||
getAvatarUrl: async (userId: number): Promise<string> => {
|
||||
const response = await client.get(`/users/${userId}/avatar`, {
|
||||
responseType: 'blob',
|
||||
})
|
||||
return URL.createObjectURL(response.data)
|
||||
},
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user