Skip to content

Commit

Permalink
Merge pull request #399 from AkshataKatwal16/reassign-cohorts
Browse files Browse the repository at this point in the history
Issue feat:Fixes bugs
  • Loading branch information
itsvick authored Nov 19, 2024
2 parents b211945 + 8dfca13 commit bae64d9
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 bae64d9

Please sign in to comment.