Merge pull request 'Fixed req in user/me for partners' (#4) from fixed-pages into main
Reviewed-on: #4
This commit is contained in:
commit
d6c268766b
@ -21,9 +21,6 @@ export const ProfileHeader = () => {
|
|||||||
const [isLoggingOut, setIsLoggingOut] = useState(false);
|
const [isLoggingOut, setIsLoggingOut] = useState(false);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (localStorage.getItem("role_status") === "18") {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (Object.keys(profileInfo).length) {
|
if (Object.keys(profileInfo).length) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -36,6 +33,16 @@ export const ProfileHeader = () => {
|
|||||||
});
|
});
|
||||||
}, [dispatch]);
|
}, [dispatch]);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
apiRequest(`/user/me`).then((profileInfo) => {
|
||||||
|
dispatch(
|
||||||
|
setProfileInfo(
|
||||||
|
profileInfo.userCard ? profileInfo.userCard : profileInfo
|
||||||
|
)
|
||||||
|
);
|
||||||
|
});
|
||||||
|
}, []);
|
||||||
|
|
||||||
const handler = () => {
|
const handler = () => {
|
||||||
setIsLoggingOut(true);
|
setIsLoggingOut(true);
|
||||||
localStorage.clear();
|
localStorage.clear();
|
||||||
|
@ -106,7 +106,10 @@ export const Profile = () => {
|
|||||||
{profileInfo?.fio ? profileInfo?.fio : profileInfo?.username}
|
{profileInfo?.fio ? profileInfo?.fio : profileInfo?.username}
|
||||||
</span>
|
</span>
|
||||||
) : (
|
) : (
|
||||||
"ООО НДВ Консалтинг"
|
<span>
|
||||||
|
<p>Добрый день, </p>
|
||||||
|
{profileInfo?.fio ? profileInfo?.fio : profileInfo?.username}
|
||||||
|
</span>
|
||||||
)}
|
)}
|
||||||
</h2>
|
</h2>
|
||||||
<div className="summary__info">
|
<div className="summary__info">
|
||||||
@ -125,7 +128,9 @@ export const Profile = () => {
|
|||||||
{profileInfo?.specification} разработчик
|
{profileInfo?.specification} разработчик
|
||||||
</span>
|
</span>
|
||||||
) : (
|
) : (
|
||||||
"ООО НДВ Консалтинг"
|
<span>
|
||||||
|
{profileInfo?.fio ? profileInfo?.fio : profileInfo?.username}
|
||||||
|
</span>
|
||||||
)}
|
)}
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
|
Loading…
Reference in New Issue
Block a user