fix:отображение описания пользователей
This commit is contained in:
@@ -10,7 +10,7 @@ const OtherProfile = () => {
|
||||
const [user, setUser] = useState(null);
|
||||
const [avatar, setAvatar] = useState('');
|
||||
const [error, setError] = useState('');
|
||||
const [user_description, setUserDescription] = useState('');
|
||||
const [description, setUserDescription] = useState('');
|
||||
|
||||
useEffect(() => {
|
||||
const checkSession = async () => {
|
||||
@@ -18,10 +18,10 @@ const OtherProfile = () => {
|
||||
const response = await axios.get('/api/users/' + id);
|
||||
setUser(response.data.display_name);
|
||||
setAvatar(response.data.avatar_url);
|
||||
if (response.data.user_description === '') {
|
||||
if (response.data.description === '') {
|
||||
setUserDescription('Описание отсутствует')
|
||||
} else {
|
||||
setUserDescription(response.data.user_description);
|
||||
setUserDescription(response.data.description);
|
||||
}
|
||||
} catch (err) {
|
||||
setError('Вы не авторизованы');
|
||||
@@ -42,7 +42,7 @@ const OtherProfile = () => {
|
||||
<div className="user-name">{user}</div>
|
||||
<img className="profile-avatar" src={avatar} alt={''}/>
|
||||
</div>
|
||||
<div className="user-description">{user_description}</div>
|
||||
<div className="user-description">{description}</div>
|
||||
</div>
|
||||
</div>
|
||||
</>
|
||||
|
||||
Reference in New Issue
Block a user