import axiosInstance from 'api/axios';
import { GET_REFERENCE } from 'api/URL';

export interface ReferenceType {
  id: number;
  title: string;
  shortDescription: string;
  price: number;
  exchange: string;
  unit: string;
  unitValue: number;
}
const reference_api = {
  async getReference(params: {
    cargoType: 'AVIA' | 'AUTO';
  }): Promise<ReferenceType[]> {
    const res = await axiosInstance.get(GET_REFERENCE, {
      params: {
        cargoType: params.cargoType,
      },
    });
    return res.data;
  },
};

export default reference_api;
