This commit is contained in:
2025-12-17 19:50:55 +07:00
parent debdd66458
commit 7e7cdbcd76
10 changed files with 225 additions and 77 deletions

View File

@@ -41,8 +41,9 @@ export const usersApi = {
},
// Получить аватар пользователя как blob URL
getAvatarUrl: async (userId: number): Promise<string> => {
const response = await client.get(`/users/${userId}/avatar`, {
getAvatarUrl: async (userId: number, bustCache = false): Promise<string> => {
const cacheBuster = bustCache ? `?t=${Date.now()}` : ''
const response = await client.get(`/users/${userId}/avatar${cacheBuster}`, {
responseType: 'blob',
})
return URL.createObjectURL(response.data)