15 lines
350 B
TypeScript
15 lines
350 B
TypeScript
export const useAgents = async () => {
|
|
const triplit = useTriplitClient();
|
|
|
|
const { results: agents } = await useQuery('agents', triplit, triplit.query('agents').Include('topics'));
|
|
|
|
const getAgent = (id: string) => {
|
|
return agents.value?.find((a) => a.id === id);
|
|
};
|
|
|
|
return {
|
|
agents,
|
|
getAgent,
|
|
};
|
|
};
|