From 8dfca139e4fdad21cb0972df1ee5378b218ac347 Mon Sep 17 00:00:00 2001 From: Akshata Katwal Date: Tue, 19 Nov 2024 13:02:28 +0530 Subject: [PATCH] Issue feat:Fixes bugs --- .../observation/[observationId]/index.tsx | 22 +++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/src/pages/observation/[observationId]/index.tsx b/src/pages/observation/[observationId]/index.tsx index 2309ce81..bf872978 100644 --- a/src/pages/observation/[observationId]/index.tsx +++ b/src/pages/observation/[observationId]/index.tsx @@ -37,7 +37,7 @@ import { fetchEntities, targetSolution, } from '@/services/ObservationServices'; -import { useTranslation } from 'react-i18next'; +import { useTranslation } from 'next-i18next'; import { CheckBoxOutlineBlankRounded } from '@mui/icons-material'; import Entity from '@/components/observations/Entity'; import SearchBar from '@/components/Searchbar'; @@ -121,9 +121,10 @@ const ObservationDetails = () => { } if (selectedCohort === '') { - const data= typeof window !== 'undefined' - ? localStorage.getItem("selectedCohort") || localStorage.getItem('role') === Role.TEAM_LEADER? response[0]?.childData[0]?.cohortId:response[0]?.cohortId - : response[0]?.childData[0]?.cohortId; + // const data= typeof window !== 'undefined' + // ? localStorage.getItem("selectedCohort") || localStorage.getItem('role') === Role.TEAM_LEADER? response[0]?.childData[0]?.cohortId:response[0]?.cohortId + // : response[0]?.childData[0]?.cohortId; + const data=localStorage.getItem("selectedCohort")?localStorage.getItem("selectedCohort"):localStorage.getItem('role') === Role.TEAM_LEADER?response[0]?.childData[0]?.cohortId:response[0]?.cohortId setSelectedCohort(data) } @@ -133,9 +134,8 @@ const ObservationDetails = () => { setMyCohortList(response); if (selectedCohort === '') { - const data= typeof window !== 'undefined' - ? localStorage.getItem("selectedCohort") || localStorage.getItem('role') === Role.TEAM_LEADER? response[0]?.childData[0]?.cohortId:response[0]?.cohortId - : response[0]?.cohortId; + const data=localStorage.getItem("selectedCohort")?localStorage.getItem("selectedCohort"):localStorage.getItem('role') === Role.TEAM_LEADER?response[0]?.childData[0]?.cohortId:response[0]?.cohortId + setSelectedCohort(data) } ; @@ -509,10 +509,10 @@ setFilteredEntityData(result) }; const handleBackEvent = () => { - router.push( - `${localStorage.getItem('observationPath')}` - ); - + // router.push( + // `${localStorage.getItem('observationPath')}` + // ); + router.push('/observation'); }; const handleStatusChange = (event: any) => {