import { useQuery } from '@tanstack/react-query';
import { cargoTypesService } from './cargo-types.service';

export const CARGO_TYPES_QUERY_KEY = ['cargo-types'];

export function useCargoTypes() {
  return useQuery({
    queryKey: CARGO_TYPES_QUERY_KEY,
    queryFn: () => cargoTypesService.getCargoTypes(),
    staleTime: Infinity,
  });
}