import { useQuery } from "@tanstack/react-query";
import { MainDtoResponse } from "../dto/SuperAdminDto";
import { getAllRecords } from "../services/api/userService";
import { ExternalQueryParams } from "./useExternalUsers";

export const useMigratedData = (unitId: string,params?:ExternalQueryParams) => {
  return useQuery({
    queryKey: ["migratedData",unitId,params],
    queryFn: async () => {
      const { data } = await getAllRecords(unitId,params);
      return data as MainDtoResponse;
    },
  });
};
