Skip to content

Commit

Permalink
Disable the Bed List of Already occupied Beds (front-end change) (#7699)
Browse files Browse the repository at this point in the history
* front-end change

* adding suggested changes
  • Loading branch information
AnkurPrabhu authored May 22, 2024
1 parent 25f51d4 commit 1fe6eb3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/Components/Assets/configure/MonitorConfigure.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { useState } from "react";
import { BedSelect } from "../../Common/BedSelect";
import { BedModel } from "../../Facility/models";
import { AssetData } from "../AssetTypes";
import { AssetClass, AssetData } from "../AssetTypes";
import * as Notification from "../../../Utils/Notifications.js";
import { Submit } from "../../Common/components/ButtonV2";
import { FieldLabel } from "../../Form/FormFields/FormField";
Expand Down Expand Up @@ -73,6 +73,7 @@ export default function MonitorConfigure({ asset }: { asset: AssetData }) {
multiple={false}
location={asset?.location_object?.id}
facility={asset?.location_object?.facility?.id}
not_occupied_by_asset_type={AssetClass.HL7MONITOR}
className="w-full"
/>
</div>
Expand Down
5 changes: 4 additions & 1 deletion src/Components/Common/BedSelect.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import AutoCompleteAsync from "../Form/AutoCompleteAsync";
import { useTranslation } from "react-i18next";
import request from "../../Utils/request/request";
import routes from "../../Redux/api";
import { AssetClass } from "../Assets/AssetTypes";

interface BedSelectProps {
name: string;
Expand All @@ -17,6 +18,7 @@ interface BedSelectProps {
showAll?: boolean;
showNOptions?: number;
selected: BedModel | BedModel[] | null;
not_occupied_by_asset_type?: AssetClass;
setSelected: (selected: BedModel | BedModel[] | null) => void;
}

Expand All @@ -33,6 +35,7 @@ export const BedSelect = (props: BedSelectProps) => {
facility,
location,
showNOptions = 20,
not_occupied_by_asset_type,
} = props;
const { t } = useTranslation();

Expand All @@ -45,8 +48,8 @@ export const BedSelect = (props: BedSelectProps) => {
all: searchAll,
facility,
location,
not_occupied_by_asset_type,
};

const { data } = await request(routes.listFacilityBeds, { query });

if (unoccupiedOnly) {
Expand Down

0 comments on commit 1fe6eb3

Please sign in to comment.