This commit is contained in:
@@ -8,13 +8,13 @@ async function handleResponse<T>(response: Response): Promise<T> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export async function fetchInventoryTree(): Promise<InventoryTreeNode[]> {
|
export async function fetchInventoryTree(): Promise<InventoryTreeNode[]> {
|
||||||
const response = await fetch('/api/inventory/tree');
|
const response = await fetch('/inventory/tree');
|
||||||
const data = await handleResponse<ListResponse<InventoryTreeNode>>(response);
|
const data = await handleResponse<ListResponse<InventoryTreeNode>>(response);
|
||||||
return data.items;
|
return data.items;
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function fetchNodeContext(id: string): Promise<NodeContext> {
|
export async function fetchNodeContext(id: string): Promise<NodeContext> {
|
||||||
const response = await fetch(`/api/inventory/nodes/${id}/context`);
|
const response = await fetch(`/inventory/nodes/${id}/context`);
|
||||||
const data = await handleResponse<EntityResponse<NodeContext>>(response);
|
const data = await handleResponse<EntityResponse<NodeContext>>(response);
|
||||||
return data.item;
|
return data.item;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user