From 10308942ac9226e6d226f8b9b57d78c98dc5235e Mon Sep 17 00:00:00 2001 From: csawatzky Date: Tue, 4 Nov 2025 12:27:10 -0600 Subject: [PATCH] now passing the type to the remove function for scans --- src/device/autoDetect/DeviceScannedComponents.tsx | 8 ++++---- src/providers/pond/deviceAPI.tsx | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/device/autoDetect/DeviceScannedComponents.tsx b/src/device/autoDetect/DeviceScannedComponents.tsx index d666264..3448b86 100644 --- a/src/device/autoDetect/DeviceScannedComponents.tsx +++ b/src/device/autoDetect/DeviceScannedComponents.tsx @@ -207,8 +207,8 @@ export default function DeviceScannedComponents(props: Props){ setComponents(cloneList) } - const removeScan = (key: string) => { - deviceAPI.removeFoundComponents(device.settings.deviceId, key) + const removeScan = (key: string, type: pond.ObjectType) => { + deviceAPI.removeFoundComponents(device.settings.deviceId, key, type) .then(resp => { console.log("Cleared this scan") }).catch(err => { @@ -227,7 +227,7 @@ export default function DeviceScannedComponents(props: Props){ I2C Sensors - + {validI2CCompAddresses.length > 0 ? validI2CCompAddresses.map((addr, index) => { return ( @@ -269,7 +269,7 @@ export default function DeviceScannedComponents(props: Props){ Port: {portLabel} diff --git a/src/providers/pond/deviceAPI.tsx b/src/providers/pond/deviceAPI.tsx index f967774..56a0c0f 100644 --- a/src/providers/pond/deviceAPI.tsx +++ b/src/providers/pond/deviceAPI.tsx @@ -149,7 +149,7 @@ export interface IDeviceAPIContext { keys?: string[], types?: string[] ) => Promise; - removeFoundComponents: (id: number, key: string, otherTeam?: string) => Promise>; + removeFoundComponents: (id: number, key: string, type: pond.ObjectType, otherTeam?: string) => Promise>; } export const DeviceAPIContext = createContext({} as IDeviceAPIContext); @@ -989,7 +989,7 @@ export default function DeviceProvider(props: PropsWithChildren) { }) } - const removeFoundComponents = (id: number, key: string, otherTeam?: string) => { + const removeFoundComponents = (id: number, key: string, type: pond.ObjectType, otherTeam?: string) => { let url = "/devices/" + id + "/removeFoundComponents/" + key; const view = otherTeam ? otherTeam : as if(view) url = url + "?as=" + view