import type { Freight, PaginatedResponse } from "@edr/types";

import { client } from "../utils/api";

export const consignmentsService = {
  list: async (): Promise<PaginatedResponse<Freight.IConsignment>> => {
    const { data } = await client.get("/consignments");
    return data.data;
  },
  get: async (id: string): Promise<Freight.IConsignment> => {
    const { data } = await client.get(`/consignments/${id}`);
    return data.data;
  },
};
