From 27e19cce7eb70ab2068335d6743f2c4cb7acce38 Mon Sep 17 00:00:00 2001 From: Ashraf Mohammed <98876115+AshrafMd-1@users.noreply.github.com> Date: Thu, 14 Dec 2023 17:13:24 +0530 Subject: [PATCH] Fixed update button in bed management. (#6841) * change update bed logic * Update src/Components/Facility/AddBedForm.tsx --------- Co-authored-by: Rithvik Nishad --- src/Components/Facility/AddBedForm.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Components/Facility/AddBedForm.tsx b/src/Components/Facility/AddBedForm.tsx index 785c90869ba..2fcda7a7a54 100644 --- a/src/Components/Facility/AddBedForm.tsx +++ b/src/Components/Facility/AddBedForm.tsx @@ -18,6 +18,7 @@ import { Cancel, Submit } from "../Common/components/ButtonV2"; import TextFormField from "../Form/FormFields/TextFormField"; import TextAreaFormField from "../Form/FormFields/TextAreaFormField"; import Page from "../Common/components/Page"; + const Loading = lazy(() => import("../Common/Loading")); interface BedFormProps { @@ -73,6 +74,7 @@ export const AddBedForm = (props: BedFormProps) => { } setIsLoading(false); } + fetchFacilityLocationAndBed(); }, [dispatchAction, facilityId, locationId]); @@ -125,7 +127,7 @@ export const AddBedForm = (props: BedFormProps) => { name, description, bed_type: bedType, - number_of_beds: numberOfBeds, + number_of_beds: bedId ? 1 : numberOfBeds, }; if (!validateInputs(data)) return;