From 449d6f83f920313d67bcfc3dae8096211a19e259 Mon Sep 17 00:00:00 2001 From: chandel-aman Date: Sat, 9 Dec 2023 04:34:56 +0530 Subject: [PATCH 1/2] fixed admin card navigation in dashboard --- src/screens/OrganizationDashboard/OrganizationDashboard.tsx | 2 +- src/screens/OrganizationPeople/OrganizationPeople.tsx | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/screens/OrganizationDashboard/OrganizationDashboard.tsx b/src/screens/OrganizationDashboard/OrganizationDashboard.tsx index 60e31396a5..5205cae25b 100644 --- a/src/screens/OrganizationDashboard/OrganizationDashboard.tsx +++ b/src/screens/OrganizationDashboard/OrganizationDashboard.tsx @@ -137,7 +137,7 @@ function organizationDashboard(): JSX.Element { role="button" className="mb-4" onClick={(): void => { - history.push(peopleLink); + history.push(peopleLink, { role: 1 }); }} > Date: Sat, 9 Dec 2023 14:43:09 +0530 Subject: [PATCH 2/2] removed the use of any --- src/screens/OrganizationPeople/OrganizationPeople.tsx | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/screens/OrganizationPeople/OrganizationPeople.tsx b/src/screens/OrganizationPeople/OrganizationPeople.tsx index a98885a7f1..8a15d4cb55 100644 --- a/src/screens/OrganizationPeople/OrganizationPeople.tsx +++ b/src/screens/OrganizationPeople/OrganizationPeople.tsx @@ -22,6 +22,10 @@ import styles from './OrganizationPeople.module.css'; import { toast } from 'react-toastify'; +interface InterfaceLocationState { + role: number; +} + function organizationPeople(): JSX.Element { const { t } = useTranslation('translation', { keyPrefix: 'organizationPeople', @@ -29,8 +33,8 @@ function organizationPeople(): JSX.Element { document.title = t('title'); - const location = useLocation(); - const role = location?.state as any; + const location = useLocation(); + const role = location?.state; const currentUrl = window.location.href.split('=')[1];