import client from './client';
export const gardensApi = {
    list: () => client.get('/api/gardens').then(r => r.data),
    get: (id) => client.get(`/api/gardens/${id}`).then(r => r.data),
    create: (g) => client.post('/api/gardens', g).then(r => r.data),
    update: (id, g) => client.put(`/api/gardens/${id}`, g).then(r => r.data),
    delete: (id) => client.delete(`/api/gardens/${id}`),
    cells: (id) => client.get(`/api/gardens/${id}/cells`).then(r => r.data),
    measurements: (id) => client.get(`/api/gardens/${id}/measurements`).then(r => r.data),
    addMeasurement: (id, m) => client.post(`/api/gardens/${id}/measurements`, m).then(r => r.data),
};
