This commit is contained in:
2026-06-19 16:53:12 +05:30
parent 5892bca44d
commit ac7c3d6313
2 changed files with 54 additions and 37 deletions

View File

@@ -12,9 +12,11 @@ export interface ReportParams {
export function useReport(params: ReportParams) {
const { get } = useResource("reports");
const { snapshot_id, ...queryParams } = params;
return useQuery({
queryKey: ["reports", "read", params],
queryFn: () =>
get(params.snapshot_id ? params.snapshot_id : "latest"),
get(snapshot_id ?? "latest", queryParams),
});
}