Skip to content

Commit

Permalink
Fix: Bed capacity pop up errors (#9123)
Browse files Browse the repository at this point in the history
  • Loading branch information
AdityaJ2305 authored Nov 19, 2024
1 parent e0264d0 commit 570ed1e
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions src/components/Facility/BedCapacity.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,8 @@ export const BedCapacity = (props: BedCapacityProps) => {
const existingData = capacityQuery.data?.results;
// if all options are diabled
if (existingData.length === BED_TYPES.length) {
setBedTypes([]);
setIsLoading(false);
return;
}
// disable existing bed types
Expand Down Expand Up @@ -277,18 +279,20 @@ export const BedCapacity = (props: BedCapacityProps) => {

<div className="cui-form-button-group mt-4">
<Cancel onClick={handleClose} />
{!isLastOptionType && headerText === "Add Bed Capacity" && (
{headerText === "Add Bed Capacity" && (
<Submit
id="bed-capacity-save-and-exit"
onClick={(e) => handleSubmit(e, "Save and Exit")}
label="Save Bed Capacity"
/>
)}
<Submit
id="bed-capacity-save"
onClick={(e) => handleSubmit(e)}
label={buttonText}
/>
{!isLastOptionType && (
<Submit
id="bed-capacity-save"
onClick={(e) => handleSubmit(e)}
label={buttonText}
/>
)}
</div>
</div>
)}
Expand Down

0 comments on commit 570ed1e

Please sign in to comment.