Fixed req in user/me for partners #4

Merged
MaxOvs19 merged 1 commits from fixed-pages into main 2023-12-18 14:30:36 +03:00
2 changed files with 17 additions and 5 deletions
Showing only changes of commit bd6f6af8de - Show all commits

View File

@ -21,9 +21,6 @@ export const ProfileHeader = () => {
const [isLoggingOut, setIsLoggingOut] = useState(false);
useEffect(() => {
if (localStorage.getItem("role_status") === "18") {
return;
}
if (Object.keys(profileInfo).length) {
return;
}
@ -36,6 +33,16 @@ export const ProfileHeader = () => {
});
}, [dispatch]);
useEffect(() => {
apiRequest(`/user/me`).then((profileInfo) => {
dispatch(
setProfileInfo(
profileInfo.userCard ? profileInfo.userCard : profileInfo
)
);
});
}, []);
const handler = () => {
setIsLoggingOut(true);
localStorage.clear();

View File

@ -106,7 +106,10 @@ export const Profile = () => {
{profileInfo?.fio ? profileInfo?.fio : profileInfo?.username}
</span>
) : (
"ООО НДВ Консалтинг"
<span>
<p>Добрый день,&nbsp;</p>
{profileInfo?.fio ? profileInfo?.fio : profileInfo?.username}
</span>
)}
</h2>
<div className="summary__info">
@ -125,7 +128,9 @@ export const Profile = () => {
{profileInfo?.specification} разработчик
</span>
) : (
"ООО НДВ Консалтинг"
<span>
{profileInfo?.fio ? profileInfo?.fio : profileInfo?.username}
</span>
)}
</p>
</div>