Skip to content

Commit

Permalink
Merge pull request #8711 from ohcnetwork/develop
Browse files Browse the repository at this point in the history
Merge Develop to Staging | Patch
  • Loading branch information
rithviknishad authored Oct 4, 2024
2 parents 25f67c9 + 8e6a2f2 commit 1e29994
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/Components/Assets/AssetType/ONVIFCamera.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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,
},
Expand Down

0 comments on commit 1e29994

Please sign in to comment.