feat(frontend): add 6 query/mutation hooks (batches, claims, remits, providers, activity, parse)
This commit is contained in:
@@ -0,0 +1,15 @@
|
||||
import { useQuery } from "@tanstack/react-query";
|
||||
import { api, type BatchSummary } from "@/lib/api";
|
||||
|
||||
/**
|
||||
* Lists parsed batches. Batches are only available when a backend is
|
||||
* configured — when running in sample-data mode there's no persisted
|
||||
* history, so we leave the query disabled.
|
||||
*/
|
||||
export function useBatches(limit?: number) {
|
||||
return useQuery<BatchSummary[]>({
|
||||
queryKey: ["batches", limit ?? null],
|
||||
queryFn: () => api.listBatches(limit),
|
||||
enabled: api.isConfigured,
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user