11 lines
240 B
TypeScript
11 lines
240 B
TypeScript
export async function listResource(id: string): Promise<any[]> {
|
|
try {
|
|
const response = await fetch(
|
|
`http://localhost:8080/resources?name=${id}`,
|
|
);
|
|
return await response.json();
|
|
} catch (error) {
|
|
return []
|
|
}
|
|
}
|