import client from './client';
export const plantsApi = {
    list: (categorie) => client.get('/api/plants', { params: categorie ? { categorie } : {} }).then(r => r.data),
    get: (id) => client.get(`/api/plants/${id}`).then(r => r.data),
    create: (p) => client.post('/api/plants', p).then(r => r.data),
    update: (id, p) => client.put(`/api/plants/${id}`, p).then(r => r.data),
    delete: (id) => client.delete(`/api/plants/${id}`),
};
