Add filter, add READMES
This commit is contained in:
9
frontend/src/graph_queries/api.ts
Normal file
9
frontend/src/graph_queries/api.ts
Normal file
@@ -0,0 +1,9 @@
|
||||
import type { GraphQueryMeta } from "./types";
|
||||
|
||||
export async function fetchGraphQueries(signal?: AbortSignal): Promise<GraphQueryMeta[]> {
|
||||
const res = await fetch("/api/graph_queries", { signal });
|
||||
if (!res.ok) throw new Error(`GET /api/graph_queries failed: ${res.status}`);
|
||||
const data = await res.json();
|
||||
return Array.isArray(data) ? (data as GraphQueryMeta[]) : [];
|
||||
}
|
||||
|
||||
3
frontend/src/graph_queries/index.ts
Normal file
3
frontend/src/graph_queries/index.ts
Normal file
@@ -0,0 +1,3 @@
|
||||
export { fetchGraphQueries } from "./api";
|
||||
export type { GraphQueryMeta } from "./types";
|
||||
|
||||
5
frontend/src/graph_queries/types.ts
Normal file
5
frontend/src/graph_queries/types.ts
Normal file
@@ -0,0 +1,5 @@
|
||||
export type GraphQueryMeta = {
|
||||
id: string;
|
||||
label: string;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user