fix results page

This commit is contained in:
Tatiana Nikolaeva 2025-06-10 08:42:07 +05:00
parent 3c466a98d3
commit 1e60984d64
9 changed files with 267 additions and 136 deletions

View file

@ -2,6 +2,7 @@ import React, { useEffect, useState } from 'react';
import styles from './Account.module.css';
import AccountImg from '../../assets/account.svg?react';
import { getCurrentUser } from '../../api/AuthApi';
import {handleUnauthorizedError} from "../../api/BaseApi.ts";
interface AccountProps {
href: string;
@ -17,6 +18,7 @@ const Account: React.FC<AccountProps> = ({ href }) => {
const userData = await getCurrentUser();
setUserName(`${userData.firstName} ${userData.lastName}`);
} catch (error) {
handleUnauthorizedError(error)
console.error("Ошибка загрузки данных пользователя:", error);
localStorage.removeItem("user");
} finally {