Skip to content

Commit

Permalink
Issue feat:Fixes bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
AkshataKatwal16 committed Nov 19, 2024
1 parent e971726 commit 8dfca13
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions src/pages/observation/[observationId]/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -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)
}
Expand All @@ -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)
} ;
Expand Down Expand Up @@ -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) => {
Expand Down

0 comments on commit 8dfca13

Please sign in to comment.