diff --git a/src/Components/Assets/AssetType/ONVIFCamera.tsx b/src/Components/Assets/AssetType/ONVIFCamera.tsx index e49fcad549d..f79894d089f 100644 --- a/src/Components/Assets/AssetType/ONVIFCamera.tsx +++ b/src/Components/Assets/AssetType/ONVIFCamera.tsx @@ -16,7 +16,9 @@ import routes from "../../../Redux/api"; import useQuery from "../../../Utils/request/useQuery"; import CareIcon from "../../../CAREUI/icons/CareIcon"; -import useOperateCamera from "../../CameraFeed/useOperateCamera"; +import useOperateCamera, { + PTZPayload, +} from "../../CameraFeed/useOperateCamera"; interface Props { assetId: string; @@ -95,18 +97,20 @@ const ONVIFCamera = ({ assetId, facilityId, asset, onUpdated }: Props) => { const addPreset = async (e: SyntheticEvent) => { e.preventDefault(); - const data = { + const meta = { bed_id: bed.id, preset_name: newPreset, }; try { setLoadingAddPreset(true); - const { data: presetData } = await operate({ type: "get_status" }); + const { data } = await operate({ type: "get_status" }); + const { position } = (data as { result: { position: PTZPayload } }) + .result; const { res } = await request(routes.createAssetBed, { body: { - meta: { ...data, ...presetData }, + meta: { ...meta, position }, asset: assetId, bed: bed?.id as string, }, diff --git a/src/Components/Common/BloodPressureFormField.tsx b/src/Components/Common/BloodPressureFormField.tsx index 205bc9a4905..e6fff756d0f 100644 --- a/src/Components/Common/BloodPressureFormField.tsx +++ b/src/Components/Common/BloodPressureFormField.tsx @@ -17,7 +17,10 @@ export default function BloodPressureFormField(props: Props) { const map = meanArterialPressure(props.value)?.toFixed(); const handleChange = (event: FieldChangeEvent) => { - const bp = field.value ?? {}; + const bp = { + systolic: field.value?.systolic, + diastolic: field.value?.diastolic, + }; bp[event.name as keyof BloodPressure] = event.value; field.handleChange(Object.values(bp).filter(Boolean).length ? bp : null); }; diff --git a/src/Components/Facility/FacilityCard.tsx b/src/Components/Facility/FacilityCard.tsx index c7fbf728dc9..f20d7c5d774 100644 --- a/src/Components/Facility/FacilityCard.tsx +++ b/src/Components/Facility/FacilityCard.tsx @@ -68,12 +68,12 @@ export const FacilityCard = (props: { facility: any; userType: any }) => { )} -
+
-
+
{(facility.read_cover_image_url && ( { > {facility.name} @@ -109,6 +109,7 @@ export const FacilityCard = (props: { facility: any; userType: any }) => { href={`/facility/${facility.id}/cns`} border ghost + className="mt-2 sm:mt-0" > { - const bp = log.bp ?? {}; + const bp = { systolic: log.bp?.systolic, diastolic: log.bp?.diastolic }; bp[event.name as keyof BloodPressure] = event.value; onChange({ bp: Object.values(bp).filter(Boolean).length ? bp : undefined,