О себе, редактирование в профиле
This commit is contained in:
@@ -25,6 +25,14 @@ export function normalizeUser(user: any): any {
|
|||||||
result.avatar = result.avatarUrl;
|
result.avatar = result.avatarUrl;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 3. Приведение bio (Settings -> bio, Profiles -> about)
|
||||||
|
if (!result.bio && result.about) {
|
||||||
|
result.bio = result.about;
|
||||||
|
}
|
||||||
|
if (!result.about && result.bio) {
|
||||||
|
result.about = result.bio;
|
||||||
|
}
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -14,9 +14,13 @@ export class UserApi {
|
|||||||
|
|
||||||
static async updateProfile(data: { displayName?: string; bio?: string; birthday?: string | null }) {
|
static async updateProfile(data: { displayName?: string; bio?: string; birthday?: string | null }) {
|
||||||
// Конечная точка в новом бэкенде: PUT /api/profiles/profile
|
// Конечная точка в новом бэкенде: PUT /api/profiles/profile
|
||||||
|
const payload = {
|
||||||
|
...data,
|
||||||
|
about: data.bio // Дублируем для совместимости
|
||||||
|
};
|
||||||
return httpClient.request<User>('/profiles/profile', {
|
return httpClient.request<User>('/profiles/profile', {
|
||||||
method: 'PUT',
|
method: 'PUT',
|
||||||
body: JSON.stringify(data),
|
body: JSON.stringify(payload),
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -263,7 +263,7 @@ export default function UserProfile({ userId, onClose, onMessage, isSelf: isSelf
|
|||||||
{/* About Section */}
|
{/* About Section */}
|
||||||
<div className="p-8 rounded-[2.5rem] bg-white/[0.02] border border-white/5 mb-10 group relative transition-colors hover:bg-white/[0.04]">
|
<div className="p-8 rounded-[2.5rem] bg-white/[0.02] border border-white/5 mb-10 group relative transition-colors hover:bg-white/[0.04]">
|
||||||
<div className="flex items-center gap-3 mb-4 text-primary"><Info size={16} /><span className="text-xs font-black uppercase tracking-[0.2em]">{t('aboutMe')}</span></div>
|
<div className="flex items-center gap-3 mb-4 text-primary"><Info size={16} /><span className="text-xs font-black uppercase tracking-[0.2em]">{t('aboutMe')}</span></div>
|
||||||
<p className="text-base text-white/80 leading-relaxed font-medium">{user.about || t('noBio')}</p>
|
<p className="text-base text-white/80 leading-relaxed font-medium">{user.bio || t('noBio')}</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{/* Tabs Nav */}
|
{/* Tabs Nav */}
|
||||||
|
|||||||
Reference in New Issue
Block a user