[ui] add fetchEntity once fn
parent
e8de358966
commit
205ca7758b
|
@ -51,6 +51,13 @@ export function useEntity(address: string) {
|
|||
};
|
||||
}
|
||||
|
||||
export async function fetchEntity(address: string): Promise<UpObject> {
|
||||
const entityFetch = await fetch(`/api/obj/${address}`);
|
||||
const entityResult = (await entityFetch.json()) as EntityListing;
|
||||
const entityListing = new UpListing(entityResult.entries);
|
||||
return entityListing.getObject(address);
|
||||
}
|
||||
|
||||
export async function fetchEntry(address: string) {
|
||||
const response = await fetch(`api/raw/${address}`);
|
||||
const data = await response.json();
|
||||
|
|
Loading…
Reference in New Issue