Add clickable relation navigation to inventory panel
CI / basic-check (push) Has been cancelled

This commit is contained in:
Perplexity Bot
2026-08-04 19:58:31 +00:00
parent 92b0136015
commit d2fd4d1078
5 changed files with 97 additions and 48 deletions
+6 -1
View File
@@ -1,4 +1,4 @@
import type { EntityResponse, InventoryTreeNode, ListResponse, NodeContext } from '../types/inventory';
import type { EntityResponse, InventoryTreeNode, ListResponse, NodeContext, Relation } from '../types/inventory';
async function handleResponse<T>(response: Response): Promise<T> {
if (!response.ok) {
@@ -21,3 +21,8 @@ export async function fetchNodeContext(id: string): Promise<NodeContext> {
const data = await fetchJson<EntityResponse<NodeContext>>(`/inventory/nodes/${id}/context`);
return data.item;
}
export async function fetchNodeRelations(id: string): Promise<Relation[]> {
const data = await fetchJson<ListResponse<Relation>>(`/inventory/nodes/${id}/relations`);
return data.items;
}