Skip to content

Commit

Permalink
Merge pull request #264 from coronasafe/develop
Browse files Browse the repository at this point in the history
fix: countries_travelled can be array or string
  • Loading branch information
SandeepThomas authored Apr 24, 2020
2 parents 80a5065 + b7a0a33 commit 38d8d4c
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/Components/Patient/ManagePatients.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ export const PatientManager = (props: any) => {
<span className="font-semibold leading-relaxed">
Travel History:{" "}
</span>
{patient.countries_travelled.join(", ")}
{Array.isArray(patient.countries_travelled) ? patient.countries_travelled.join(", ") : patient.countries_travelled.split(',').join(', ')}
</>)}
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion src/Components/Patient/PatientHome.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,7 @@ export const PatientHome = (props: any) => {
</div>
{patientData.countries_travelled && !!patientData.countries_travelled.length && (<div className="md:col-span-2">
<span className="font-semibold leading-relaxed">Countries travelled: </span>
{patientData.countries_travelled.join(', ')}
{Array.isArray(patientData.countries_travelled) ? patientData.countries_travelled.join(", ") : patientData.countries_travelled.split(',').join(', ')}
</div>)}
{patientData.ongoing_medication && (<div className="md:col-span-2">
<span className="font-semibold leading-relaxed">Ongoing Medications </span>
Expand Down
2 changes: 1 addition & 1 deletion src/Components/Patient/models.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export interface PatientModel {
estimated_contact_date?: string;
past_travel?: boolean;
ongoing_medication?: string;
countries_travelled?: Array<string>;
countries_travelled?: Array<string> | string;
present_health?: string;
has_SARI?: boolean;
local_body?: number;
Expand Down

0 comments on commit 38d8d4c

Please sign in to comment.