Skip to content

Commit

Permalink
fix: mater request check right on pop source
Browse files Browse the repository at this point in the history
  • Loading branch information
Mehdi-BOUYAHIA committed Apr 3, 2024
1 parent 807055a commit 37e99c4
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/components/CreationCohort/Requeteur.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ const Requeteur = () => {
allowSearchIpp = false
} = useAppSelector((state) => state.cohortCreation.request || {})
const criteriaData = useAppSelector((state) => state.cohortCreation.criteria || {})
const user = useAppSelector((state) => state.me)

const params = useParams<{
requestId: string
Expand Down Expand Up @@ -81,8 +80,7 @@ const Requeteur = () => {
try {
const criteriaCache = await getDataFromFetch(criteriaList, selectedCriteria, criteriaData.cache)

const selectedPopulationIds = selectedPopulation?.map((perimeter) => perimeter?.cohort_id)
const allowMaternityForms = selectedPopulationIds?.every((id) => user?.nominativeGroupsIds?.includes(id))
const allowMaternityForms = selectedPopulation?.every((population) => population?.access === 'Nominatif')

dispatch(
setCriteriaData({
Expand Down

0 comments on commit 37e99c4

Please sign in to comment.