Skip to content

Commit

Permalink
Remove unnecessary null checks added in Consultation card
Browse files Browse the repository at this point in the history
  • Loading branch information
mohanrajnambe committed Mar 7, 2024
1 parent a6106d2 commit e8ea0eb
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/Components/Facility/ConsultationCard.tsx
Expand Up @@ -21,9 +21,9 @@ export const ConsultationCard = (props: ConsultationProps) => {
const { itemData, isLastConsultation, refetch } = props;
const { kasp_string } = useConfig();
const [open, setOpen] = useState(false);
const bedDialogTitle = itemData?.discharge_date
const bedDialogTitle = itemData.discharge_date
? "Bed History"
: !itemData?.current_bed
: !itemData.current_bed
? "Assign Bed"
: "Switch Bed";
return (
Expand All @@ -34,12 +34,12 @@ export const ConsultationCard = (props: ConsultationProps) => {
onClose={() => setOpen(false)}
className="md:max-w-3xl"
>
{itemData?.facility && itemData?.patient && itemData?.id ? (
{itemData.facility && itemData.patient && itemData.id ? (
<Beds
facilityId={itemData?.facility}
patientId={itemData?.patient}
discharged={!!itemData?.discharge_date}
consultationId={itemData?.id ?? ""}
facilityId={itemData.facility}
patientId={itemData.patient}
discharged={!!itemData.discharge_date}
consultationId={itemData.id ?? ""}
setState={setOpen}
fetchPatientData={refetch}
smallLoader
Expand Down Expand Up @@ -192,7 +192,7 @@ export const ConsultationCard = (props: ConsultationProps) => {
<ButtonV2
className="h-auto whitespace-pre-wrap border border-gray-500 bg-white text-black hover:bg-gray-300"
onClick={() => {
if (itemData?.admitted && !itemData?.current_bed) {
if (itemData.admitted && !itemData.current_bed) {
Notification.Error({
msg: "Please assign a bed to the patient",
});
Expand Down

0 comments on commit e8ea0eb

Please sign in to comment.