import { fetchOrganizationById } from "@/record-management/services/api/organizationService";
import { useQuery } from "@tanstack/react-query";

const useOrganizationUnit = (id: string) => {
  return useQuery({
    queryKey: ["organizationUnit", id],
    queryFn: () => fetchOrganizationById(id),
    enabled: !!id,
    staleTime: 5 * 60 * 1000,
  });
};

export default useOrganizationUnit;
