import client from './client';
export const plantingsApi = {
    list: () => client.get('/api/plantings').then(r => r.data),
    get: (id) => client.get(`/api/plantings/${id}`).then(r => r.data),
    create: (p) => client.post('/api/plantings', p).then(r => r.data),
    update: (id, p) => client.put(`/api/plantings/${id}`, p).then(r => r.data),
    delete: (id) => client.delete(`/api/plantings/${id}`),
    events: (id) => client.get(`/api/plantings/${id}/events`).then(r => r.data),
    addEvent: (id, e) => client.post(`/api/plantings/${id}/events`, e).then(r => r.data),
};
