Fix avatars upload

This commit is contained in:
2025-12-17 00:04:14 +07:00
parent 895e296f44
commit 1c07d8c5ff
9 changed files with 234 additions and 45 deletions

View File

@@ -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)
},
}