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

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

