О себе, редактирование в профиле

This commit is contained in:
Халимов Рустам
2026-04-17 00:26:38 +03:00
parent 7225e3272e
commit ca9cf27716
3 changed files with 14 additions and 2 deletions

View File

@@ -25,6 +25,14 @@ export function normalizeUser(user: any): any {
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;
}

View File

@@ -14,9 +14,13 @@ export class UserApi {
static async updateProfile(data: { displayName?: string; bio?: string; birthday?: string | null }) {
// Конечная точка в новом бэкенде: PUT /api/profiles/profile
const payload = {
...data,
about: data.bio // Дублируем для совместимости
};
return httpClient.request<User>('/profiles/profile', {
method: 'PUT',
body: JSON.stringify(data),
body: JSON.stringify(payload),
});
}

View File

@@ -263,7 +263,7 @@ export default function UserProfile({ userId, onClose, onMessage, isSelf: isSelf
{/* 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="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>
{/* Tabs Nav */}