From 041b8cd5afd5e437ec77aec71dd74ea98892b7e4 Mon Sep 17 00:00:00 2001 From: syedfardeenjeelani Date: Thu, 26 Sep 2024 07:00:49 +0530 Subject: [PATCH 1/2] fix: modify bed creation notification to show proper action-related message #8627 --- src/Components/Facility/AddBedForm.tsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Components/Facility/AddBedForm.tsx b/src/Components/Facility/AddBedForm.tsx index 0a612fa776b..f93d94c1760 100644 --- a/src/Components/Facility/AddBedForm.tsx +++ b/src/Components/Facility/AddBedForm.tsx @@ -124,10 +124,14 @@ export const AddBedForm = ({ facilityId, locationId, bedId }: Props) => { res?.ok && onSuccess("Bed updated successfully"); } else { // Create + const { res } = await request(routes.createFacilityBed, { body: { ...data, facility: facilityId, location: locationId }, }); - res?.ok && onSuccess("Bed(s) created successfully"); + console.log(res); + res?.ok && numberOfBeds > 1 + ? onSuccess("Bed(s) created successfully") + : onSuccess("Bed created successfully"); } }; From e10ba1a089f8c80e6ed171d206760e2aa702ce0b Mon Sep 17 00:00:00 2001 From: Fardeen <154688163+syedfardeenjeelani@users.noreply.github.com> Date: Thu, 26 Sep 2024 08:22:48 +0530 Subject: [PATCH 2/2] Update AddBedForm.tsx Removed console.log from the file --- src/Components/Facility/AddBedForm.tsx | 1 - 1 file changed, 1 deletion(-) diff --git a/src/Components/Facility/AddBedForm.tsx b/src/Components/Facility/AddBedForm.tsx index f93d94c1760..925c706fb29 100644 --- a/src/Components/Facility/AddBedForm.tsx +++ b/src/Components/Facility/AddBedForm.tsx @@ -128,7 +128,6 @@ export const AddBedForm = ({ facilityId, locationId, bedId }: Props) => { const { res } = await request(routes.createFacilityBed, { body: { ...data, facility: facilityId, location: locationId }, }); - console.log(res); res?.ok && numberOfBeds > 1 ? onSuccess("Bed(s) created successfully") : onSuccess("Bed created successfully");