import { api } from "../../auth/http";

export const wagonService = {
  async getWagons() {
    const response = await api.get('/wagons');
    return response.data;
  },
  async getWagonById(id: string) {
    const response = await api.get(`/wagons/${id}`);
    return response.data;
  },
  async createWagon(data: any) {
    const response = await api.post('/wagons', data);
    return response.data;
  },
  async updateWagon(id: string, data: any) {
    const response = await api.patch(`/wagons/${id}`, data);
    return response.data;
  },
  async deleteWagon(id: string) {
    await api.delete(`/wagons/${id}`);
  },
};