removed client data massaging with backend report using feature/report
This commit is contained in:
17
src/features/report/useReport.ts
Normal file
17
src/features/report/useReport.ts
Normal file
@@ -0,0 +1,17 @@
|
||||
import { useQuery } from "@tanstack/react-query";
|
||||
import { fetchReport } from "./report.api";
|
||||
|
||||
export interface ReportParams {
|
||||
period: "weekly" | "monthly" | "yearly" | "fyly";
|
||||
rolling?: boolean;
|
||||
report_date?: string;
|
||||
group_by?: ("flow" | "payee" | "tags")[];
|
||||
ignore_self?: boolean;
|
||||
}
|
||||
|
||||
export function useReport(params: ReportParams) {
|
||||
return useQuery({
|
||||
queryKey: ["report", params],
|
||||
queryFn: () => fetchReport(params),
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user