Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: Bed capacity pop up errors #9123

Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading