Skip to content

Commit

Permalink
fix: fixes some bug
Browse files Browse the repository at this point in the history
  • Loading branch information
Mehdi-BOUYAHIA committed Oct 11, 2023
1 parent 6d0bc86 commit cca20a4
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 7 deletions.
9 changes: 8 additions & 1 deletion src/components/CreationCohort/Requeteur.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,14 @@ const Requeteur = () => {
onRedo={_canRedo() ? _onRedo : undefined}
/>

{!requestIdFromUrl && !requestId && <ModalCreateNewRequest onClose={() => dispatch(setSelectedRequest(null))} />}
{!requestIdFromUrl && !requestId && (
<ModalCreateNewRequest
onClose={() => {
dispatch(setSelectedRequest(null))
navigate('/home')
}}
/>
)}
</>
)
}
Expand Down
2 changes: 1 addition & 1 deletion src/services/aphp/callApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -788,7 +788,7 @@ const getCodeList = async (
}
const res = await apiFhir.post<FHIR_API_Response<ValueSet>>(`/ValueSet/$expand`, JSON.stringify(json))
const valueSetExpansion = getApiResponseResourceOrThrow(res).expansion
return valueSetExpansion?.contains
return valueSetExpansion?.contains?.map((code) => ({ ...code, codeSystem: codeSystem }))
}
}

Expand Down
7 changes: 2 additions & 5 deletions src/services/aphp/serviceCohorts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -572,11 +572,8 @@ const servicesCohorts: IServiceCohorts = {

fetchCohortsRights: async (cohorts) => {
try {
const ids = cohorts
.map((cohort) => {
return cohort.fhir_group_id
})
.filter((id) => id !== '')
const ids = cohorts.map((cohort) => cohort.fhir_group_id).filter((id) => id !== '')
if (ids.length === 0) return []
const rightsResponse = await apiBackend.get(`cohort/cohorts/cohort-rights/?fhir_group_id=${ids}`)
return cohorts.map((cohort) => {
return {
Expand Down
1 change: 1 addition & 0 deletions src/services/aphp/serviceProjects.ts
Original file line number Diff line number Diff line change
Expand Up @@ -430,6 +430,7 @@ const servicesProjects: IServiceProjects = {

// Récupère les droits
const cohortList = await servicesCohorts.fetchCohortsRights(data.results)
if (cohortList.length === 0) return data
return {
...data,
results: cohortList
Expand Down

0 comments on commit cca20a4

Please sign in to comment.