diff --git a/src/components/Ecosystem/Dashboard.tsx b/src/components/Ecosystem/Dashboard.tsx index 4fa471c61..80f76bfd8 100644 --- a/src/components/Ecosystem/Dashboard.tsx +++ b/src/components/Ecosystem/Dashboard.tsx @@ -18,6 +18,7 @@ import { ICheckEcosystem, checkEcosystem, getEcosystemId, + getOwnerAdminRole, } from '../../config/ecosystem'; import { Button, Dropdown } from 'flowbite-react'; import EditPopupModal from '../EditEcosystemOrgModal'; @@ -198,14 +199,19 @@ const Dashboard = () => { const navigateToInvitation = () => { window.location.href = pathRoutes.ecosystem.sentinvitation; }; + const [isAccess, setIsAccess] = useState(false); + const checkEcosystemData = async () => { + const data: ICheckEcosystem = await checkEcosystem(); + setIsEcosystemLead(Boolean(data)); + }; + const checkEcosystemAccess = async () => { + const data = await getOwnerAdminRole(); + setIsAccess(data); + }; useEffect(() => { getDashboardData(); - - const checkEcosystemData = async () => { - const data: ICheckEcosystem = await checkEcosystem(); - setIsEcosystemLead(data.isEcosystemLead); - }; + checkEcosystemAccess() checkEcosystemData(); }, []); @@ -330,7 +336,8 @@ const Dashboard = () => {