19 lines
595 B
TypeScript
19 lines
595 B
TypeScript
import { useQuery } from "@tanstack/react-query";
|
|
|
|
import { ENDPOINT } from "@/shared/config";
|
|
|
|
import type { DashboardMainSearchDto } from "../model/dashboard-interface";
|
|
|
|
import { dashboardService } from "./dashboard-service";
|
|
|
|
export const dashboardBaseKey = [ENDPOINT.AS_SERVICE.DASHBOARD] as const;
|
|
|
|
const EMPTY_SEARCH: DashboardMainSearchDto = {};
|
|
|
|
export function useGetMainDashboard(params: DashboardMainSearchDto = EMPTY_SEARCH) {
|
|
return useQuery({
|
|
queryKey: [...dashboardBaseKey, "getMainDashboard", params],
|
|
queryFn: () => dashboardService.getMainDashboard(params),
|
|
});
|
|
}
|