import { apiClient } from './apiClient.js'

export const shipmentsApi = {
  create: (payload) => apiClient.post('/api/shipments', payload).then((r) => r.data),
  getAll: () => apiClient.get('/api/shipments').then((r) => r.data),
  getOne: (shipmentNumber) =>
    apiClient.get(`/api/shipments/${shipmentNumber}`).then((r) => r.data),
  update: (shipmentNumber, payload) =>
    apiClient.put(`/api/shipments/${shipmentNumber}`, payload).then((r) => r.data),
  delete: (shipmentNumber) =>
    apiClient.delete(`/api/shipments/${shipmentNumber}`).then((r) => r.data),
}

