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`);