garage-erp/apps/dashboard/modules/home/use-dashboard-data.ts
Mohammad Khyata c7eb23dd3f fix bugs
Co-authored-by: Copilot <copilot@github.com>
2026-05-07 13:32:35 +03:00

17 lines
502 B
TypeScript

"use client"
import { useQuery } from "@tanstack/react-query"
import { useAuthApi } from "@/shared/useApi"
import type { HomeDashboardQuery, HomeDashboardResponse } from "@garage/api"
export type DashboardData = HomeDashboardResponse & Record<string, any>
export function useDashboardData(filters?: HomeDashboardQuery) {
const api = useAuthApi()
return useQuery<DashboardData>({
queryKey: ["home", "dashboard", filters],
queryFn: () => api.home.dashboard(filters),
})
}