Skip to content

Commit

Permalink
[FIX] Fixed parsing of NB_IS_FEDERATION_API (#88)
Browse files Browse the repository at this point in the history
* Fixed parsing of `NB_IS_FEDERATION_API`

* Modified the fix so the default is `true`
  • Loading branch information
rmanaem authored Mar 18, 2024
1 parent 5cf66be commit 4ac0bf0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/components/QueryForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -95,14 +95,14 @@ function QueryForm({
/>
</div>
)}
<div className={isFederationAPI && 'row-start-2'}>
<div className={isFederationAPI ? 'row-start-2' : ''}>
<ContinuousField
helperText={minAgeExceedsMaxAge ? '' : minAgeHelperText}
label="Minimum age"
onFieldChange={updateContinuousQueryParams}
/>
</div>
<div className={isFederationAPI && 'row-start-2'}>
<div className={isFederationAPI ? 'row-start-2' : ''}>
<ContinuousField
helperText={minAgeExceedsMaxAge ? '' : maxAgeHelperText}
label="Maximum age"
Expand Down
6 changes: 4 additions & 2 deletions src/utils/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,10 @@ export const nodesURL: string = baseAPIURL.endsWith('/')
? `${baseAPIURL}nodes/`
: `${baseAPIURL}/nodes/`;

export const isFederationAPI: string =
import.meta.env.NB_IS_FEDERATION_API === undefined ? true : import.meta.env.NB_IS_FEDERATION_API;
export const isFederationAPI: boolean =
import.meta.env.NB_IS_FEDERATION_API === undefined
? true
: import.meta.env.NB_IS_FEDERATION_API === 'true';

export const sexes: { [key: string]: string } = {
male: 'snomed:248153007',
Expand Down

0 comments on commit 4ac0bf0

Please sign in to comment.