From 472cc601a64dc23c32204dfcde2eb54fd335a43a Mon Sep 17 00:00:00 2001 From: admin Date: Thu, 6 Aug 2026 16:35:31 +0000 Subject: [PATCH] fix(api): add fetchObjects export for InventoryView and TopologyView compatibility --- frontend/src/lib/api.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/frontend/src/lib/api.ts b/frontend/src/lib/api.ts index 3c3dbaa..e3e401a 100644 --- a/frontend/src/lib/api.ts +++ b/frontend/src/lib/api.ts @@ -1,5 +1,5 @@ import { getToken, clearSession } from './session'; -import type { ServiceInfo } from '../types'; +import type { NetObject, ServiceInfo } from '../types'; const BACKEND = '/backend'; const AGENT = '/api'; @@ -45,6 +45,11 @@ export async function apiDelete(path: string): Promise { if (!res.ok) throw new Error(`DELETE ${path} failed: ${res.status}`); } +// Inventory objects - authenticated via apiGet +export async function fetchObjects(): Promise { + return apiGet('/objects'); +} + // Legacy agent calls (unauthenticated local agent) export async function fetchServices(): Promise { const res = await fetch(`${AGENT}/services`);